Question Locked

Schedule Windows Shut Down on logon ...

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I need to write a script (DOS or PERL) which would shut down the windows system after one hour (60 mins) of logon. i.e if user 'ABC' logs in at 10:00 AM the system should shut down automatically at 11:00 AM with a message just before 15 secs of shutdown.

Could someone adivice me on this...

Thanks.

- Pat

2 replies

by rob miners

call this from a logon script or add it.

Set WshShell=WScript.CreateObject("WScript.Shell")
WScript.Sleep 3600000
WshShell.run "shutdown.exe -s"

It will throw up a warning that the PC will be Shutdown in 30 seconds, but it doesn't take that long.

Someone else may have a better idea as scripting isn't my forte.

This discussion is closed to new replies.