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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Allications to start using one shortcut? 1

Status
Not open for further replies.

AppSpecialist

Programmer
Jul 6, 2001
64
CA
Help?!?

I need to find a way to start two programs when the user selects a single shortcut?

Any ideas... using a single shortcut, script, batch file etc...?

Basically when program 1 starts... I need to ensure program 2 starts.
 
I wouldn't have a clue on writing batch files, as my example will show, but it does work for me.

Create a batch file and then place a shortcut to it on the Desktop.

This is my example (from a non-scripting user)

"C:\Documents and Settings\xxxxthe username\My Documents\Mix\Shortcut to program.lnk"
"C:\Program Files\Magic\Magic.exe"
pause "Done"
exit

The above starts two processes, one after the other.
 
Thanks... but this is not really applicable as both these programs will stay running.

Soemthing like this waits for program1 to complete before program 2 starts.

Also it leaves the batch shell running, which is not desireable.
 
Use the start command....

start "c:\program files\...\application1.exe"
start "c:\program files\...\application2.exe"

... in a batch file. Set the properties on the batch file icon to close the window when finished.

--Greg



Just my $0.02

"In order to start solving a problem, one must first identify its owner." --Me
--Greg
 
Here's a simple VB script that would do it:

dim objShell
set objShell = CreateObject("WScript.Shell")
objShell.run "c:\path\to\firstapp.exe", 1, False
objShell.run "c:\path2\to\secondapp.exe", 1, False

copy/paste the above text into a text file and give it a .vbs extension. You can add as many programs as you want just by adding more "objShell.run" lines.
The "1" means open in a normal window. Use "2" for minimized or "3" for maximized windows. The false tells it not to wait for this app to finish before opening the next.
 
Hi AppSpecialist,

I I understand you correctly you want to start two applications, but not at the same time.

Create a MyApp.cmd and add the following.

@Echo off
Title MyApp is running.
start /wait "c:\program files\...\application1.exe"
start "c:\program files\...\application2.exe"
exit

By using the /wait switch, application2 will not start untill application1 has ended.
You can also use the /min switch to run an application minimized.

Open a Command Prompt and enter "start /?" to see some more options you might want to use. Read it carefully.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top