MSFN Forum: Shutdown scripts - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Shutdown scripts Rate Topic: -----

#1 User is offline   Bigtime5000 

  • Group: Members
  • Posts: 8
  • Joined: 17-June 04

  Posted 11 March 2008 - 07:37 AM

Hi guys,

Sorry if this has been asked before (I have looked ). Can anyone give me any advice/ guidence on the following problem I have.

The situation is I work for the IT dept of a school, probably about 600 pc`s maybe more. currently I have thenm all set to autopower on at 8:00AM
but there are an awfull lot of them that just get left on all night.

What I am looking for is a script or something that will run at a specific time and shut the pc`s down. The only issue I can possibly see is that all the students have there own logon on the domain. so the pc`s are usually locked when a student is not using them so the script would need to run in the background I guess.

Any help or advice would be great

Thanks in advance :thumbup


#2 User is offline   luke.mccormick 

  • Member
  • PipPip
  • Group: Members
  • Posts: 215
  • Joined: 16-February 06

Posted 11 March 2008 - 07:44 AM

Set it up as a scheduled task?

#3 User is offline   kimokid 

  • Group: Members
  • Posts: 6
  • Joined: 23-July 05

Posted 11 March 2008 - 07:49 AM

Hi,

Have a look at AutoIT, there are some scripts there to automatically shutdown the PC, also look into running script as a service, this will allow it to be run when PC is locked or logged out.


http://www.autoitscript.com/forum/index.ph...amp;hl=shutdown

#4 User is offline   Glenn9999 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 588
  • Joined: 23-April 07

Posted 11 March 2008 - 07:53 AM

A scheduled task would be what you would want. The question that remains is how, and to that end you would need to identify the main OS in question. Very easy if it's XP (and probably Vista) - look into the shutdown command.

You could try something like:
C:\> at 18:00 /interactive /every:M,T,W,Th,F,S,Su c:\windows\shutdown.exe -i -l 600 
 -m “It is way past the time you should be at home.  Come back tomorrow.”


Documentation:
AT
SchTasks - more proper for XP perhaps
Shutdown

#5 User is offline   Bigtime5000 

  • Group: Members
  • Posts: 8
  • Joined: 17-June 04

Posted 11 March 2008 - 09:17 AM

Thanks for the quick reply`s guys. Just looking into your suggestions now :thumbup

#6 User is offline   Team929 

  • IT Grunt
  • Pip
  • Group: Members
  • Posts: 60
  • Joined: 20-September 02

Posted 26 March 2008 - 10:54 PM

Don't know if all OS's have shutdown.exe so you can google and download it as the previous thread says. I believe the one I have used is a stand-alone executable that shuts down the PC and can be called through a script. Or a batch file called from a scheduled task, etc., whichever you like.

#7 User is offline   gunsmokingman 

  • MSFN Addict
  • Group: Super Moderator
  • Posts: 1,991
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 27 March 2008 - 07:33 AM

Here is a vbs script that you might be able to use. Since it using WMI you can run it
against remote machines.

Quote

 Const LogOff = 0,  Shutdown = 1, Reboot = 2,PowerOff = 8
 Dim ObjOS, strComputer, StrOS, Wmi
  strComputer = "."
  Set Wmi = GetObject("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\" & _
		strComputer & "\root\cimv2")
  Set ObjOS = Wmi.ExecQuery("Select * from Win32_OperatingSystem")
   For Each StrOS in ObjOS
'-> 4 Means Force The System
	StrOS.Shutdown(Shutdown + 4)
   Next


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy