Is this possible with a batch file or something else?

Joined
Aug 19, 2018
Messages
63
I need to start program 1
then pause for 15 seconds
then start program 2 and start program 3

Have all this run without the user seeing the command window (invisible mode)
and start this batch file with a hot key
 
Yes that should be possible, but it depends on how crazy you want to get.

So step 1 is make your batch file, and put it somewhere. Inside of the batch file first line just called out the complete path to program 1. Then you would put in "timeout 15" and that would give you a 15 second count down. After that line put in the next 2 lines as the next two programs you want to run. You need to use either call or start when calling the programs so it doesn't stop the batch file from continuing to the next line. Without start it will launch the first program, then wait until it's closed before continuing to the timeout.

Batch file would look something like this:

start c:\app\prog1.exe
timeout 15
start c:\app\prog2.exe
start c:\app\prog3.exe

Then to start it minimized and with a hot key, you need to create a shortcut to the batch file. Open properties of the shortcut, change run to minimized, and set the shortcut key.

That accomplishes everything other than you'll still get the little command prompt in the tray while it's launching applications. If you don't want that to show up then you'll have to chain something else like a .vbs script to make a hidden command window:


I think this is the easiest and shortest solution to running a batch file without opening the DOS window, it can be very distracting when you want to schedule a set of commands to run periodically, so the DOS window keeps popping up, here is your solution. Use a VB Script to call the batch file ...

Set WshShell = CreateObject("WScript.Shell" )
WshShell.Run chr(34) & "C:\Batch Files\ mycommands.bat" & Chr(34), 0
Set WshShell = Nothing

Copy the lines above to an editor and save the file with .VBS extension. Edit the .BAT file name and path accordingly. Then just run the .vbs file and the magic happens!
You can create a task on Task Scheduler then in the Action should be Start a program then select this .vbs script you created. Depending on your requirements the other properties you can fill and save.

https://superuser.com/questions/233...le-that-does-not-show-the-command-prompt-when
 
Back
Top