Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Shutdown computers with no one logged on..comments  (Read 2036 times)

0 Members and 1 Guest are viewing this topic.

balcarras

  • Guest
Shutdown computers with no one logged on..comments
« on: March 22, 2007, 10:49:20 AM »
I have found and adapted a script....

Wondered if those with more scripting knowledge than me can cast their eye over it and see if there is any reason why this should nt work....

@echo off
setlocal
for /f "Tokens=1" %%c in ('net view^|Find "\\"') do (
for /f "Tokens=1,2*" %%i in ('psloggedon -L %%c^|find "/"') do (
if /i "%%c" EQ "\\%ComputerName%" PsShutdown -s -c -t 60 -f %%c
)
)
endlocal


Thanks.