It probably references itself. Can you post the contents?
Alternatively, Shutdownertron will do the job for you, no scripts involved.
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!
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."
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.
I'll give it a go, looks an awful lot tidier than batch files and the like!
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
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!
Makes sense guys, cheers
Gave up with the script. Shutdownertron was so much easier!
powdarrmonkey (8th May 2009)
There are currently 1 users browsing this thread. (0 members and 1 guests)