📎 AI Summary:
The thread discusses issues with a batch file failing to launch the first two programs, which only briefly show a window before closing. The original poster discovers that the programs require an INI file and corrects this by adding a `CD` command to set the working directory. Other contributors suggest techniques like using the `PAUSE` command for debugging and specifying the starting directory in the `START` command for cleaner code. Overall, the troubleshooting leads to successfully running the programs by ensuring correct directories and file dependencies.

English Rebel

New Member
Member details
Joined
Jun 8, 2013
Messages
6
Thread Author #1
I have created a batch file to run three programs. However it doesn't run the first two just the last one. Whenever the batch file is running I see a window open and quickly close when each of the first two programs are requested to run. The window is only open for a second so I cannot see what it is but appears to be a standard Windows window that is empty but I can just make out the name of one of the programs in the bar at the top.
For each file I'm adding the line Start "" "the executable file path"
Here's what I used in the batch file:


@echo off
Start "" "the executable file path"
Exit

Any idea why the first two programs won't run as I can double click their .exe files or their shortcuts and they run just fine? Is there a way to see what happened when the batch file ran (a Windows log file perhaps)?
Thanks
Alan
 

Solution
I think I've answered my own question. The two exe files won't run because they need an INI file. The solution is to add a CD line with the folder location and then a START XXX.exe. The third program ran because it doesn't need an INI file.

English Rebel

New Member
Member details
Joined
Jun 8, 2013
Messages
6
Thread Author #2
I think I've answered my own question. The two exe files won't run because they need an INI file. The solution is to add a CD line with the folder location and then a START XXX.exe. The third program ran because it doesn't need an INI file.
 
Solution

patcooke

Microsoft MVP
Microsoft MVP
Member details
Joined
May 16, 2010
Messages
5,688
ok - for future reference you could use the "PAUSE" command at points where you want to monitor activity - this will execute the batch file as far as the pause commend then wait for a key to be pressed before continuing.
 

English Rebel

New Member
Member details
Joined
Jun 8, 2013
Messages
6
Thread Author #4
Okay thanks I'll remember that for future troubleshooting. I think in my case the program window that briefly appeared would not pause.
 

Josephur

Windows Forum Admin
Staff member
Premium Supporter
Microsoft Certified Professional
Member details
Joined
Aug 3, 2010
Messages
1,284
You can also use start /d <path_here> to specify the path the program should execute in, thus eliminating the need for the CD command. (much cleaner)

Obtained from "start /?"

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
[command/program] [parameters]

path Starting directory.