VBScript

  VBScript : シャットダウン



  
Set Shell = Wscript.CreateObject( "Shell.Application" )
Shell.ShutdownWindows()
  

  
Set WshShell = Wscript.CreateObject( "WScript.Shell" )
Call WshShell.Run("taskkill /im explorer.exe", 0 )
  

  
Set WshShell = Wscript.CreateObject( "WScript.Shell" )
Call WshShell.Run("shutdown -s -t 0", 0 )
  

  
Const LOGOFF = 0
Const SHUTDOWN = 1
Const REBOOT = 2
Const FORCED_LOGOFF = 4
Const FORCED_SHUTDOWN = 5
Const FORCED_REBOOT = 6
Const POWEROFF = 8
Const FORCED_POWEROFF = 12

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & _
	"{impersonationLevel=impersonate,(Shutdown)}!\\" & _
	strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
	ObjOperatingSystem.Win32Shutdown(SHUTDOWN)
Next
  










  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ