Shutdown computers at night, but prompt users

J

Jordan

I have a couple of batch files on a server that run nightly, the first one
parses a NET VIEW /DOMAIN:MYCOMPANY command to get the list of the
computers that are still powered on. This then feeds it into a second batch
file that will see if it is on an exception list and if not it will issue
the command to shut it down in 5 minutes:

shutdown -m \\ComputerName -t 300 -c "Turning off" -s

This works great, but just in case I have someone that needs to stop the
shutdown I would like an easy way for them to do it rather than running
"shutdown /a". Is there a way to pop up something on their screen that is a
countdown and if they click something within the 5 minutes it does not shut
them down?
 
H

Holz

I have a couple of batch files on a server that run nightly, the first
one parses a NET VIEW /DOMAIN:MYCOMPANY command to get the list of
the computers that are still powered on. This then feeds it into a
second batch file that will see if it is on an exception list and if
not it will issue the command to shut it down in 5 minutes:

shutdown -m \\ComputerName -t 300 -c "Turning off" -s

This works great, but just in case I have someone that needs to stop
the shutdown I would like an easy way for them to do it rather than
running "shutdown /a". Is there a way to pop up something on their
screen that is a countdown and if they click something within the 5
minutes it does not shut them down?

Not that I know off without descent programming, but you could set a
hidden link on their desktop to a batch running from the network
"shutdown -a" and set the link to visible using your batch, and
pop "Click twice on stop shutdown".
Just a thought.

attrib %userprofile%\desktop\file.lnk -h
shutdown -m \\ComputerName -t 300 -c "click twice..." -s
attrib %userprofile%\desktop\file.lnk +h

Not perfect but a start :)
 
J

Jordan

I found out that I can create an HTA file that will run shutdown and on the
HTA window I can have a button to run shutdown -a.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top