1.

Solve : new to batch files?

Answer»

ok i am learning to make batch files and i was bored and i desided to see if i could make a batch file to run my aim,msn messenger and yahoo messenger all at the same time, but for some reason the yahoo messenger will not work, i am running windows xp pro and this is the code:

echo off
:start

:aim
start aim.exe
GOTO msn

:msn
start msnmsgr.exe
goto yahoo

:yahoo
start ypager.exe
exit
:end

i am new so this might be a stupid question sorry

p.s. i am aware of programs like trillian and i don't realy want to use it or any others, i just want to be able to start all three programs at the same time, this is simply just to see if i can do it, so its not realy too important, but it has been bugging me becuase i can't get it

thanks in advance for any helpIt would have been HELPFUL if you had posted an error message or any other indication of why it failed.

The system may not be able to FIND YPAGER (not in current directory or a directory on the PATH). Either include a path on the start COMMAND or use a CHDIR (CD works too) command before issuing the START YPAGER.EXE.

i got it, i didn't think of the cd command untill you mentioned it thank you


this is wat i changed the code to:

echo off
:start

:aim
cd\
cd program files
cd aim
start aim.exe
goto msn

:msn
cd\
cd program files
cd msn messenger
start msnmsgr.exe
goto yahoo

:yahoo
cd\
cd program files
cd yahoo!
cd messenger
start ypager.exe
exit
:end


and it works fine now

thanks againok well i ran into another problem, this should be the last for awhile i hope:

ok well wenever i TRY to use the start command to start a program that has a space in the name such as "space test.txt" it gives an error saying it can not find the file called space, this is the code i have been using:

start space test.txt

i have also tried:

start "space test.txt"
witch just opens command prompt with the root to the batch file but it doesn't open the .txt file

is there anything i can do to get it to pick up on the space?

thanks again in advanceYou had the right idea about the quotes. Non-executable file types need to be opened with another program (usually the program that created them). Check your file associations for text files (TXT extensions) and see what program is setup to open it.

My Computer-->Tools>--Folder Options-->File Types

Scroll down to TXT and see what's listed. The program assigned to TXT files may no longer be on your system.

Just my 2½ cents worth. thanks


but wat i mean is, when i run a program with command prompt it opens up like normal if i had clicked on it with my mouse, i am trying to acheive the same thing,

but i will just keep trying things, and hopefully i will get it working

thanks againo sorry, when i said program i meant all things, like .wma and .txt and .jpg and others
Code: [Select]echo off
rem this will open any file with the default program

"file name.extention"

exit
http://wow Code: [Select]echo off
rem this will open any file with the default program

"file name.extention"

exit


Good Luck
         Sigma thanks i got it



Discussion

No Comment Found