macca Posted May 3, 2007 Posted May 3, 2007 has anyone created a batch file to shutdown PCs that could be run as a sheldule task at the end of the day
6Foot2 Posted May 3, 2007 Posted May 3, 2007 We are doing that every night using PSTools and the following command in a .CMD file: psshutdown -m "This computer will shutdown in 5 minutes. Please save any unsaved work." -t 300 -f \\stationname.domainname.local You can download PSTools from the Sysinternals pages of the Microsoft website. Hope this helps.
Andi Posted May 3, 2007 Posted May 3, 2007 We use a tool called LanViewer which scripts this for you nicely amongst other features. All free too. I believe the link is in the downloads section of this site. An example of the script you could run would be: "shutdown.exe -s -m \\computername" There are other switches you can put in to warn the users, or force a shutdown if someone is logged on etc, but this is what we use nightly with no issues.
Heebeejeebee Posted May 3, 2007 Posted May 3, 2007 We're doing it here to but with the usual windows command: shutdown -m \\pcname-s -t 60 -c "If you're still here - you shouldn't be, type of message" Batch file(s) in the scheduled task set to run at around 9:30pm. We have to leave it that late because of evening classes etc. We also run a script that shuts curriculum machines down just after the students are meant to leave (about an hour after school finishes) and the batch file that runs in the evening catches any that have been turned on since then plus admin machines. HBJB
plexer Posted May 3, 2007 Posted May 3, 2007 If they are xp and you have 2003 server you can use the built in shutdown command. Create a text file containing the names of the pc's you wish to shut down. Then create a batch file containing: FOR /F %%f IN (06.txt) DO shutdown -s -f -m \\%%f ] -c "You should have switched me off Dave" Ben
leon Posted May 3, 2007 Posted May 3, 2007 Here's mine. It checks to see which machines are on 1st which reduces the time taken to run. There's a skip list to exlude servers etc...domainshutdownmk2.zip 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now