Sign in with
Sign up | Sign in
Your question
Solved

What's wrong with my batch file?

Last response: in Apps General Discussion
Share
July 31, 2010 2:53:27 PM

I wrote my first batch file in Notepad and save it as Firefox.bat:

@echo off
start firefox.exe


When I ran Firefox.bat, I got an error message reading:

Windows cannot find 'firefox.exe'. Make sure you typed the name correctly, and then try again.


Firefox.exe it's clearly in its folder:

More about : wrong batch file

a b L Programming
July 31, 2010 3:21:20 PM

That folder is not (I presume) in the default PATH variable. Put the full path to the program in your batch file:

start "C:\Program Files\Mozilla Firefox\firefox.exe"
m
0
l
July 31, 2010 3:38:37 PM

So, like this:

@echo off
start firefox.exe
"C:\Program Files\Mozilla Firefox\firefox.exe"

Even though this starts up Firefox, I still get the error message.
m
0
l
Related resources

Best solution

a b L Programming
July 31, 2010 4:23:51 PM

No, No:

@echo off
start "C:\Program Files\Mozilla Firefox\firefox.exe"

(Actually, the "start" is redundant. You could just put

@echo off
"C:\Program Files\Mozilla Firefox\firefox.exe"
)
Share
August 2, 2010 8:22:36 PM

Best answer selected by Advice Pro.
m
0
l
!