Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can you get 2 apps to start at the same time from within a .bat?

Status
Not open for further replies.

finny388

Programmer
Jul 16, 2001
19
CA
I'm trying to create a shortcut that will both open a text file and launch an exe. In a bat file, the text file opens, but the exe won't fire until I close the editor holding the text file.
I want the exe to run after the editor(textfile) opens but not wait until it closes.

Are there other approaches to this as well?

Thanks.
 
You can prepend a "START" to the line in the .cmd file to start another command window. Each will then run independently.
Code:
Start notepad
Start sol

I don't know if this will work on the older OSes like Win95, 98, ME, etc. It may be NT/2000/XP specific.

Chip H.
 
Prepending with Start doesn't work. It opens up a dos window/prompt for each Start statement at the directory where the .bat resides. I renamed it to .cmd and same result. I have:
Start "H:\Client\FGG\FGG.TXT"
Start "H:\Client\FGG\fggviewer.exe"
The bat file is on my desktop so the result is two windows at a dos prompt:
C:\Documents and Settings\user\Desktop>

Using Windows 2000.
 
Assuming that you are happy to control everything from a VB app rather than a batch file, you can launch Notepad via the CreateProcess API call, immediately followed by WaitForInputIdle API call against the process handle. This should ensure that Notepad is completely launched before proceeeding
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top