Click here for important information about

Batch script to shutdown PC

July 7, 2010 at 22:40:18
Specs: Windows XP

I am trying to write one batch script to shutdown the pc if no user is login. Here is the script : -

qwinsta | find /c "Active" > C:\WINDOWS\Temp\res.txt

set /p shutvar=<C:\WINDOWS\Temp\res.txt

if %shutvar%==0 (
shutdown -s -t 60 -c "system shutdown")

But this script is not working. System is not getting shutdown with this

See More: Batch script to shutdown PC

July 8, 2010 at 01:39:38
sgadmin , do you have a screensaver or some other proggie running in the background which might make it appear the machine's 'active'? Otherwise you'll likely get more and more knowledgeable responses in the programming forum @:
Ed in Texas.

Report •
Related Solutions

Ask Question