'NoStandByMenu.vbs 'Remove Standby choice from shutdown menu 'v 1.1 adds create key if Parameters is missing 'v 1.2 fixes false repor of faqilure when bLocalOnly true 'alan dot kaplan at va dot gov '7/2/2009, 7/4 Option Explicit Dim strComputer, strPath, strEntry, intValue, intReturn Dim objReg Const HKLM = &H80000002 Dim bLocalOnly bLocalOnly = False 'set to true for SMS or other install to avoid name prompt Dim WshShell Set wshShell = WScript.CreateObject("WScript.Shell") strComputer = wshShell.ExpandEnvironmentStrings("%COMPUTERNAME%") If Not bLocalOnly Then If WScript.Arguments.Count = 1 Then strComputer = WScript.Arguments(0) Else strComputer = InputBox("Remove Standby from shutdown menu on what PC","Computer Name",strComputer) End If End If If strcomputer = "" Then WScript.Quit strComputer = UCase(strComputer) strPath = "SYSTEM\CurrentControlSet\Services\ACPI\Parameters" strEntry = "Attributes" intValue = 112 'remove On Error Resume Next Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") If Err <> 0 Then WScript.Echo strComputer & ",failed: " & Err.Description WScript.Quit End If objReg.CreateKey HKLM, strPath intReturn = objReg.SetDWORDValue(HKLM, strPath,strEntry, intValue) If Not bLocalOnly Then If intReturn = 0 Then WScript.Echo strComputer & ",success" Else WScript.Echo strComputer & ",failed" End If End If