this is fun, also allows forced shoutdown
also shutdown /force will terminate any programs and for the computer to turn off.
' SHUT DOWN AND RESTART IN VB6
Const EWX_LogOff As Long = 0
Const EWX_SHUTDOWN = 1
Const EWX_REBOOT = 2
Const EWX_FORCE = 4
Private Declare Function ExitWindows _
Lib "User32" Alias "ExitWindowsEx" _
(ByVal dwOptions As Long, ByVal dwReserved As Long) As Long
Private Sub Command1_Click()
'Shut down windows
ExitWindows EWX_SHUTDOWN, &HFFFFFFFF
Private Sub Command2_Click()
ExitWindows EWX_REBOOT, &HFFFFFFFF
force does what it says and will make sure the computer goes off.
To completely eliminate the risk of electrical fire when the building is closed, it's best to unplug everything and shut off the main power
Our computers are divided into 3 OUs - ICT Suite, Classroom and Admin. Initially, I didn't use the GP on the Admin machines, but I do now. It doesn't seem to cause a problem. It also gives me a timeslot when I can be certain nobody will be logged on.
Last edited by elsiegee40; 5th February 2008 at 05:45 PM.
As elsiegee40 says, forced logoffs/shutdowns will only be a problem if you do them at problematic times of day.
Work out when each computer/location stops being used, and then set scripts to shut those PCs down after that time, or just run one big script round the network once everyone has gone home.
Gotta love education, in any other industry who ever used the equipment would be responsible for switching it off.
I use PSSHUTDOWN, works very well.
We share a DT block with another school, who do turn off their ring mains at night. Probably something to do with the old DT block converting it's self into a smoldering mess.
It's interesting this has been brought up - at our place a notice has gone round asking people to shut their PC's off at night (news to me). But it could be something to do with the electrics in this place having just been condemmned, and the electrical feed into the build being very, very warm to touch!
Our computers are always shut down on a schedule on a night and do not turn on automatically on a morning - we let the users do that and the school yearly electricity bill is £65k.
I would hate to see how much it would be if the computers are left longer then the 4:00PM shutdown - although they would use too much up individually over a year 700 computers must pull some power through.
well when I've come in this morning there are 86 machines showing on vncon... just seems to be odd ones dotted about everywhere.
anyway, I had someone ringing me from capita yesterday asking if i wanted a job... working with SIMs and installing it in schools around blackburn and doing general tekkie things. Not sure what to do.... we have a thing about them!!
I made separate batch files for shutting down different sets of PCs, but they all take this format:
X99.txt contains a list of your computers in this format:Code:@for /F "eol=# tokens=1,2 delims=," %%i in (X99.txt) do @ping -n 1 -w 750 %%i |find "TTL=" >nul && @shutdown -s -m \\%%i -t 0 -f -c "shutdown batch (run by %username%)" & @sleep -m 750 & @echo %%i shutting down...
(the mac addresses aren't required for this, but I use the same text files for my wake-on-lan scripts.Code:#FQDNs and mac addresses of X99-01 to X99-03 # X99-01.domain.blah, 0011760d57e9 X99-02.domain.blah, 0011760d57d6 X99-03.domain.blah, 0011206a3012
You will need a copy of sleep.exe if you want this to run through steadily rather than blasting through the whole lot at the same time.
Also, it needs to be run as a batch file. Running it from the commandline as is will not work because of the escaped (doubled) percent signs.
So fires are ok in the daytime, just not at night?
Does this mean I should be putting a Halon dump* in the server room?
*yes, I know we can't use Halon any more.
There are currently 1 users browsing this thread. (0 members and 1 guests)