has anyone created a batch file to shutdown PCs that could be run as a sheldule task at the end of the day
has anyone created a batch file to shutdown PCs that could be run as a sheldule task at the end of the day

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.
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.
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

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:
BenCode:FOR /F %%f IN (06.txt) DO shutdown -s -f -m \\%%f ] -c "You should have switched me off Dave"
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...
There are currently 1 users browsing this thread. (0 members and 1 guests)