Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Shutdown script that ignores logged on users....comments?


Recommended Posts

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...