Computer Hope
Microsoft => Microsoft DOS => Topic started by: deathavenger13 on December 14, 2007, 09:06:56 AM
-
ok..i have a problem with a .batch file im running.... lets say i open "a.bat" the code i have so far is:
echo (
start iexplore.exe www.google.com
exit
)
>"a1.bat
start a1.bat
now i know this is wrong...i also tried
echo start iexplore.exe www.google.com|exit>"a1.bat
start a1.bat
..now before u start saying "just do 'start www.google.com'", i NEED to open google through this format, and be able to for future reference, and not just opening google...
thx all!
-
In the TV version of M*A*S*H, Major Charles Emerson Winchester said he did one thing at a time, did it very well and then moved on.
Words to live by. Don't try to do everything at once:
echo start iexplore.exe www.google.com > a1.bat
echo exit >> a1.bat
Once a1.bat is created, you can launch the program with start a1.bat
8)
-
thanks Sidewinder ;)! that really helped, and now it doesnt break anymore ;D
-
I've come across another problem with this...
...
echo echo Hello World >> a1.bat
echo pause>nul >> a1.bat
...
appears to work fine, but when I call or start a1.bat it is just "pause" instead of "pause>nul". Is there anyway to get it to say "pause>nul" through the format above? And if not, is there anyway I can do this that is automated?
Thx!
-
Try using the escape character (^):
echo pause ^> nul >> a1.bat
8)