Auto Shutdown PC

binoyxj

PrOuD InDiAn
Joined
4 May 2008
Messages
475
Open Notepad

Copy and paste the script given below

@echo off
echo Enter Seconds To Shutdown
set /p stime=
cls
echo Your PC Will Auto Shutdown after %stime%
choice /t %stime% /c yn /d y /n /m "Press 'n' to abort shutdown"

if ERRORLEVEL 2 goto ext
if ERRORLEVEL 1 goto sht

:sht
shutdown -s -t 00
goto ext

:ext
exit

Save the text as AutoShutdown.bat

Double click the file, It will prompt to enter shut down time in seconds. Enter time in seconds and hit Enter. System will shut down at the specified time....
 
Or, you could just type:

shutdown -s -t XX

🙂

You can even use the shutdown command to remotely shutdown a machine. Like so...

shutdown -s (or -r for restart) -m \\whateverthecomputernameis -t 30

This assumes you have credentials on that machine. Works best in an environment with a domain of course.
 
or i could just press "shutdown"?
 
Or use the Hobbylounge gadget for date/time that allows you to shut-down/restart or hibernate at the click of a button on your sidebar in Vista.
 
I was playing around this and my first thought as well was why not just use

shutdown -t XX

But it didn't work for me, it shutdown the machine immediately, I could get it to work for a remote machine, but not for the local machine.

Here's the real irony:

shutdown was first automatically included win WinXP (on 2K/NT it's in the resource kit I think)

choice is a command included with Win98 (but it is not automatically installed with XP though if you upgraded you would still have it.

So either way, you have to search for one of them shutdown.exe or choice.com. Not everyone will have both.

Then I wonder, why would I want to do this? Automatically shutdown my machine from a shortcut? Maybe as a funny prank, or maybe to logout of the machine is idle for a specific period of time for strict security environments?
 
just wonderng ..after laptop contest how many ppl came to this forum and new things to everyone... good sign 🙂
 

Members online

No members online now.

Forum statistics

Threads
62,021
Messages
673,242
Members
5,642
Latest member
osipov
Back
Top