|
Answer» hi all i have problem with my batch file.
i tried a simple echo but when i RUN the batch file the cmd just appear and closes almost immediately.
after which i tried "shutdown -s -t 30" and SURPRISINGLY when i run the batch file, i get an infinite loop and it NEVER shut down.
i'm kinda new to these things so would appreciate it if anybody could offer me any help.
Thanks in advance!can you maybe post the code so we may look at what you did?the following are the 2 sets of code that i used to test:
echo hello world
and
shutdown -s -t 30
thank you that is all? all you did is put
echo hello world
in a text file and saved it as a batch? there has to be more code to the file than that...Oh, I think I understand. It sounds like that is all you did. ok. Well what is happening is that message you typed in IS popping up in the window, but there is nothing to keep the window there. You would need to use a command such as Pause. Also you may want to TURN echo off.
Instead of:
Code: [Select]echo hello world try:
Code: [Select]@echo off echo hello world pause or if you don't want the pause phrase to appear, try:
Code: [Select]@echo off echo hello world pause>NULhi yea that is all to my testing code. it worked fine few days ago, but when i tried it again now, the problem surfaced.
anyway, i tried what you suggested and it worked fine now, thanks a lot ;0yupp. you're very welcome. lol I'm glad to answer BASIC questions but im no master at batch scripts.
|