Windows Thread, Shutdown.bat in Technical; I was wondering if anyone can explain this error -
I've just put in a scheduled task to Shutdown all ...
6th May 2009, 10:20 AM #1
I was wondering if anyone can explain this error -
I've just put in a scheduled task to Shutdown all of the PC's (a pupil used to do it to 'help' me but the campus size is too big now).
It's only a batch file, using the Shutdown machine to warn users for 20 mins then turn off the pc's.
If the batch file is called 'shutdown.bat' then it doesn't execute properly, instead going round in circles on the first machine in the list.
If it's called 'TurnOff.bat' then the same file works perfectly!
Just wondering if anyone has an explaination!
6th May 2009, 10:22 AM #2
It probably references itself. Can you post the contents?
Alternatively, Shutdownertron will do the job for you, no scripts involved.
Thanks to powdarrmonkey from:
6th May 2009, 10:34 AM #3
All it is is line after line of the following (with different machine names).
I can't use IP addresses as I have a very short lease set (due to not having enough IP's, but thats on its way to being fixed) and we have a residential part of the school, so I can't turn off those PC's at 18:00!
shutdown -f -t 1200 -m \\FWS-ADM-100 -c "This is the nightly Shutdown for all PC's."
6th May 2009, 10:41 AM #4
Hi you could also look at a script I wrote that uses machine names from Active Directory. This script uses vbs does not need a client and can allow users to opt out via a GPO option. It also logs process to a file. You may be able to change script so it use a simple array of names if you do not want to link with AD structure.
Documentation and script can be found here.
6th May 2009, 10:47 AM #5
I love this software, give it a go its excellent.
Originally Posted by powdarrmonkey
6th May 2009, 11:04 AM #6
I'll give it a go, looks an awful lot tidier than batch files and the like!
6th May 2009, 11:06 AM #7
There's a conflict between Shutdown.exe (the program you want to call) and Shutdown.bat (when ran) - as you only call 'shutdown'. Either use the full path to shutdown.exe, or rename the batch file
6th May 2009, 11:07 AM #8
If you save the file as shutdown.bat, the first path searched for shutdown will be the local directory and will just rerun the batch file - which will rerun the batch file - which will... etc. Changing the line to
Originally Posted by Mr. Ben
shutdown.exe -f -t 1200 -m \\FWS-ADM-100 -c "This is the nightly Shutdown for all PC's."
should fix it as it will now explicitly be looking for the exe file, not the bat.
Edit : Doh. Longer answer beaten by quick one!
Thanks to OutToLunch from:
6th May 2009, 11:14 AM #9
8th May 2009, 10:37 AM #10
Gave up with the script. Shutdownertron was so much easier!
Thanks to Mr.Ben from:
powdarrmonkey (8th May 2009)
By Chuckster in forum Windows
Last Post: 30th April 2009, 01:15 PM
By Dos_Box in forum General Chat
Last Post: 11th July 2008, 02:19 PM
By cookie_monster in forum MIS Systems
Last Post: 11th February 2008, 01:28 PM
By robert.mabbutt in forum MIS Systems
Last Post: 15th August 2007, 10:43 PM
By Uraken in forum Scripts
Last Post: 30th January 2007, 11:41 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)