Help with "shutdown" batch file

  tobyb121 19:08 27 May 07
Locked

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
:A
cls
echo ----------
echo -TURN OFF-
echo ----------
set /p t =time
shutdown -s %t %
pause
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 07

.

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 07

I answered your query here, tobyb121. click here

  tobyb121 14:29 28 May 07

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

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

Sony Xperia XZ Premium review: Hands-on with the new 4K HDR phone with Motion Eye camera and Snapdr5…

1995-2015: How technology has changed the world in 20 years

Best laptop for design and art 2017: we test Apple, Dell, HP, Lenovo and Microsoft's best models…

CarPlay tips & troubleshooting guide: CarPlay tips & troubleshooting guide: Get the most from…