• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Batch File Help

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

tenchi86

Member
Joined
Oct 19, 2004
Location
Smoky Mountains, NC
Hello, I am trying to run a few of my programs using a Batch file. I would like a file to load Napster.exe, then have a delay for 25 seconds after which it would load firefox.exe and WoW.exe.

From searching some and what I knew before(Have not made a batch since last time I posted here about this haha) I came up with a few things to try.

The problem with this one is only Napster will load based on shortcuts. I can put the .bat in the Firefox folder which makes both Firefox and Napster load fine, WoW however dosn't of course. The Error that pops up is "unable to find (Filename)"
@ECHO OF
start WoW.exe
start Napster.exe
start Firefox.exe
cls

This one loads the first request fine no matter the order, though the other two commands never go through.
@ECHO OFF
"C:\Program Files\World Of Warcraft\WoW.exe"
"C:\Program Files\Napster\Napster.exe"
"C:\Program Files\Mozilla Firefox\firefox.exe"

Same as first one though the /MIN replaces what I would need a delay for.
@ECHO OF
start /MIN WoW.exe
start /MIN Firefox.exe
start Napster.exe
cls

From googling I found
TYPE NUL | CHOICE.COM /N /CY /TY,5 >NUL
As the command to delay the batch file. So I tried
@ECHO OF
start Napster.exe
TYPE NUL | CHOICE.COM /N /CY /TY,25 >NUL
start WoW.exe
start Firefox.exe
cls

Of course just as everything else this also did not work. This is mainly for learning as I could easily just copy the Mozilla files into the WoW folder and have it load, or create a real program to do this. Batch files though seem interesting to me so I would like to learn how to properly do basic commands like this with them. Thanks
 
Last edited:
IIRC batch scripts are just simple programs that execute one line at a time, wait for it to complete then moves on to the next one. i.e. it won't run the next program until whatever it launches closes. On that note. why didn't you combine the first and the second?

so

@ECHO OFF
start "C:\Program Files\World Of Warcraft\WoW.exe"
start "C:\Program Files\Napster\Napster.exe"
start "C:\Program Files\Mozilla Firefox\firefox.exe"

since you said, napster loads, firefox only loads if batch is in the firefox directory and wow says cannot find file. Meaning you need a path for firefox and wow and that will make them both load
 
pik4chu said:
IIRC batch scripts are just simple programs that execute one line at a time, wait for it to complete then moves on to the next one. i.e. it won't run the next program until whatever it launches closes. On that note. why didn't you combine the first and the second?

so

@ECHO OFF
start "C:\Program Files\World Of Warcraft\WoW.exe"
start "C:\Program Files\Napster\Napster.exe"
start "C:\Program Files\Mozilla Firefox\firefox.exe"

since you said, napster loads, firefox only loads if batch is in the firefox directory and wow says cannot find file. Meaning you need a path for firefox and wow and that will make them both load
ok try it like this, upon doing start /? I noticed that the " " are used for something else. so you need to add "" in front as well. I tested it using C:\Program Files\Battle Castles\BattleCastles.exe (just a game with spaces in path) and it works if you do start "" "C:\Program Files\Battle Castles\BattleCastles.exe" so try that

so try
@ECHO OFF
start "" "C:\Program Files\World Of Warcraft\WoW.exe"
start "" "C:\Program Files\Napster\Napster.exe"
start "" "C:\Program Files\Mozilla Firefox\firefox.exe"
 
tenchi86 said:
Thanks for the help. I forgot to mention I did try that, all that happens though is CMD comes up three times.

One thing you could do is remove the @echo off line from the file.
Then open a command window and run the batch from there. Then you can see what the batch is doing.
The only purpose of the start command is to open a new cmd window to run the program in the same line. I think you dont need it.
What happens if you remove the start command and have the file look like this:

"C:\Program Files\World Of Warcraft\WoW.exe"
"C:\Program Files\Napster\Napster.exe"
"C:\Program Files\Mozilla Firefox\firefox.exe"

edit: Nevermind. doesnt work without the start command. Using pik4chu's example i was able to run 2 programs like this on my computer.

start "" "C:\Program Files\CCleaner\ccleaner.exe"
start "" "C:\Program Files\Microsoft Bootvis\bootvis.exe"
 
Last edited:
Thanks that does work. One more question.
1. Since I am trying to learn this a little better can you explain a little more what "" mean to cmd?

Anyway here is the final one incase anyone is interested:
@ECHO OFF
start "" "C:\Program Files\Napster\Napster.exe"
PING 1.1.1.1 -n 8 -w 1000 >NUL
start "" "C:\Program Files\Mozilla Firefox\firefox.exe"
start "" "C:\Program Files\World Of Warcraft\WoW.exe"
cls

The Ping 1.1.1.1 part is the delay I needed. It tries to ping that and sees it can't so waits 8 seconds and goes on. I Found some other ways to do it but they all involved Winodws Resource Kit which I don't have. Anyway thanks a lot for the help.
 
Last edited:
tenchi86 said:
Thanks that does work. One more question.
1. Since I am trying to learn this a little better can you explain a little more what "" mean to cmd?

Anyway here is the final one incase anyone is interested:
@ECHO OFF
start "" "C:\Program Files\Napster\Napster.exe"
PING 1.1.1.1 -n 8 -w 1000 >NUL
start "" "C:\Program Files\Mozilla Firefox\firefox.exe"
start "" "C:\Program Files\World Of Warcraft\WoW.exe"
cls

The Ping 1.1.1.1 part is the delay I needed. It tries to ping that and sees it can't so waits 8 seconds and goes on. I Found some other ways to do it but they all involved Winodws Resource Kit which I don't have. Anyway thanks a lot for the help.

When you run the start command, it looks for a title in "" before the path, so if you put the path in quotes, it will think it is the title for the new window it is opening. If you put start "" "path" you are telling it that the title is nothing, so the next quotes will be the path.

Code:
MICROSOFT DOS
    Information about the start command.

SYNTAX

Starts a separate window to run a specified program or command.

START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/WAIT] [/B] [command/program]
[parameters]
"title" 	Title to display in window title bar
path 	Starting directory
/B 	Start application without creating a new window. The application has ^C handling ignored. Unless the application enables ^C processing, ^Break is the only way to interrupt the application
/I 	The new environment will be the original environment passed to the cmd.exe and not the current environment
/MIN 	Start window minimized
/MAX 	Start window maximized
/SEPARATE 	Start 16-bit Windows program in separate memory space
/SHARED 	Start 16-bit Windows program in shared memory space
/LOW 	Start application in the IDLE priority class
/NORMAL 	Start application in the NORMAL priority class
/HIGH 	Start application in the HIGH priority class
/REALTIME 	Start application in the REALTIME priority class
/ABOVENORMAL 	Start application in the ABOVENORMAL priority class
/BELOWNORMAL 	Start application in the BELOWNORMAL priority class
/WAIT 	Start application and wait for it to terminate
command/program 	If it is an internal cmd command or a batch file then the command processor is run with the /K switch to cmd.exe. This means that the window will remain after the command has been run.

If it is not an internal cmd command or batch file then it is a program and will run as either a windowed application or a console application.
parameters 	These are the parameters passed to the command/program
 
Back