PDA

View Full Version : .bat file to start multiple apps


Fred Forsythe
05-03-2006, 08:09 PM
I recently had to reload an OS, win2k. I had previously used the following .bat file to open my 3 Internet associated programs with a single keystroke (iTouch keyboard). Now when I run the command, all I get are 3 command prompt windows simply saying "G:\>" as if it can't find the directory "Program Files" (had been one window, opening briefly as the commands executed, then closing, followed by the programs starting). Any ideas what might be wrong? Locations are all correct:

@echo off
start "G:\Program Files\Mozilla Firefox\firefox.exe"
start "G:\Program Files\Mozilla Thunderbird\thunderbird.exe"
start "G:\Program Files\Hotmail Popper\hotpop.exe"
cls

TIA

Fred

mjc
05-03-2006, 08:48 PM
The first thing I always do is to double (triple) check the path...just becuase it was right last time I ran it, doesn't, necessarily, mean it is now...especially after a reinstall.

Fred Forsythe
05-03-2006, 09:03 PM
Thanks MJC. I actually copied & pasted the paths from WE (right click the executable, select properties, hightlight the location and add \filename.exe). When I run the .bat, it doesn't even seem to be getting as far as the "Program Files" directory. And oddly, I see if I open a command prompt, I am not able to get to the directory "Program Files" using "cd Program_Files" from G:\. It says "Invalid Directory", even though the directory appears if you execute "dir" from G:\. Might the OS think it (either the drive letter or the directory itself) is called something else? If so, how can I find this out?

TIA

Fred

mjc
05-03-2006, 09:21 PM
2K shouldn't be worried about DOS 8.3 names, but you may want to try G:\Progra~1 or variations on caps/no caps.

tommy
05-04-2006, 02:14 AM
Try running the .bat after changing "off" to "on" in the @echo command. Sometimes the "off" suppresses OS messages telling you what is wrong.

Fred Forsythe
05-04-2006, 04:30 PM
Thanks for the replies. Changing the off to on had no effect. As a test, I copied calc.exe to the root directory of G:\ and tried this .bat:

@echo on
start "G:\calc.exe"
cls

Same thing, the command box opens with G:\>, but the box just remains open & no calculator :confused:

Fred

Paul Komski
05-04-2006, 09:03 PM
In my WinXP as things stand the inverted commas must be dropped and 8dot3 used for long names. viz:


start c:\windows\system32\calc.exe
start c:\progra~1\mozill~1\firefox.exe


opens both apps for me when other command lines fail.

Fred Forsythe
05-05-2006, 12:00 AM
Paul-Thanks for the reply. Eliminating the commas, I was able to get the calc.exe .bat to work, but the internet one that starts firefox, tbird +hotmail popper yields 3 command windows each saying "cannot find g:\program files\mozilla firefox\firefox (using firefox as the example) or one of its components. Make sure that path and file names are correct" I tried changing "program files" to progra~1, same thing. I'm afraid I don't understand this naming convention & searching has not helped. I tried this:

@echo off
start G:\progra~1\Mozill~1 Firefo~1\firefo~1.exe
start G:\progra~1\Mozill~1 Thunde~1\Thunde~1.exe
start G:\progra~1\Hotmai~1 Popper\hotpop.exe
cls

Thinking the deal was "3 letters, tilden, 1". This opens 2 WE windows, 1 to the "g:\program files\Mozilla Firefox" directory & one to the "g:\program files\Hotmail Popper" directory. Oddly, it ignores the tbird line. :confused:

How does this 8dot3 business work???

Fred

mjc
05-05-2006, 01:55 AM
Try this...(just copy and paste it)

@echo off
start G:\progra~1\Mozill~1\firefox.exe
start G:\progra~1\Mozill~2\Thunde~1.exe
start G:\progra~1\Hotmai~1\hotpop.exe
cls

Paul Komski
05-05-2006, 03:44 AM
For the future.

(1) The 8dot3 naming convention only truncates if the 8 or the 3 gets EXCEEDED and there are other rules for multiple similarly named files in a folder:
http://en.wikipedia.org/wiki/8.3_(computing) (http://en.wikipedia.org/wiki/8.3_%28computing%29)

(2) You can see how and which names Windows has modified by typing dir/x at the relevant command prompt in WinXP and (I think) Win2K.

Fred Forsythe
05-05-2006, 10:40 AM
Thanks MJC & Paul, the suggested script works like a charm, as does running the dir/x from a command prompt! And thanks Paul for the link, I did try wiki but searching "8dot3" yielded what appeared to be pages of irrelevant entries.

Thanks again!

Fred