Help with "shutdown" batch file

  tobyb121 19:08 27 May 2007

I am new to batch files, but found a tutorial somewhere that teaches you how to create a batch to shutdown your computer. i also have a batch file that creates a messenger program. I wanted to integrate them to create a file so that i could specify how long until i want my computer to shutdown, so far I have got what i think should work, but it just doesn't seem to work.this is what i have so far

@echo off
echo ----------
echo -TURN OFF-
echo ----------
set /p t =time
shutdown -s %t %
goto A

to uderstand the problem paste the above script into notepad, and name it whatever you want (except shutdown)and give it a file extension .bat .
the file runs and looks like its going to work, but then fails. i don't see why it isn't working, but if you can please help, tobyb121

  Peter 22:48 27 May 2007


I have run your batch file and, under Windows 98SE, it fails at the line "shutdown -s %t %" as the programme "shutdown" cannot be found. If you construct your batch file with the first line "@echo off" removed, you will be able to see the error messages that are generated and thus the line containing the problem. All lines of the batch file will be displayed on screen when the file is run so it can be a bit confusing.

If you just want a line that will shutdown Windows try :-

C:\WINDOWS\RUNDLL.EXE user.exe,exitwindows

Hope this helps, Peter.

  MAJ 23:23 27 May 2007

I answered your query here, tobyb121. click here

  tobyb121 14:29 28 May 2007

Thanks MAJ
the batch file is now working, thanks for your help.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Huawei MateBook X Pro review: Hands-on

The art of 'British' pulp fiction

Best password managers for Mac

TV & streaming : comment regarder le Tournoi des Six Nations 2018 ?