Jump to content

Recommended Posts

Posted

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!

Posted

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

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.

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

  • Thanks 1
Posted
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 :)
  • Thanks 1
Posted
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!

  • Thanks 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...