Mr.Ben Posted May 6, 2009 Posted May 6, 2009 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!
powdarrmonkey Posted May 6, 2009 Posted May 6, 2009 It probably references itself. Can you post the contents? Alternatively, Shutdownertron will do the job for you, no scripts involved. 1
Mr.Ben Posted May 6, 2009 Author Posted May 6, 2009 Hi powdarrmonkey, 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."
Guest monkeyx Posted May 6, 2009 Posted May 6, 2009 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.
FN-GM Posted May 6, 2009 Posted May 6, 2009 It probably references itself. Can you post the contents? Alternatively, Shutdownertron will do the job for you, no scripts involved. I love this software, give it a go its excellent. 1
Mr.Ben Posted May 6, 2009 Author Posted May 6, 2009 I'll give it a go, looks an awful lot tidier than batch files and the like!
webman Posted May 6, 2009 Posted May 6, 2009 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 1
OutToLunch Posted May 6, 2009 Posted May 6, 2009 Hi powdarrmonkey, 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." 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 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! 1
Mr.Ben Posted May 8, 2009 Author Posted May 8, 2009 Gave up with the script. Shutdownertron was so much easier! 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