Set startup delay (VBScript)

This code can be found in Chapter 2 of Windows Server Cookbook

Purchase XP Cookbook or Networking Recipes for only $25 plus shipping! While supplies last.

Find out how to download all of the VBScript code from this site.

' This code sets the startup delay to 10 seconds.
' ---------------------------------------------------------------
' From the book "Windows Server Cookbook" by Robbie Allen
' ISBN: 0-596-00633-0
' ---------------------------------------------------------------

' ------ SCRIPT CONFIGURATION ------
strComputer = "."  ' e.g. rallen-srv01
' ------ END CONFIGURATION ---------
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colCompSys = objWMI.InstancesOf("Win32_ComputerSystem")
for Each objCompSys in colCompSys
    WScript.Echo "Startup Delay Before: " & objCompSys.SystemStartupDelay
    objCompSys.SystemStartupDelay = 10
    objCompSys.Put_
    WScript.Echo "Startup Delay After: " & objCompSys.SystemStartupDelay
next

This code has been viewed 2578 times.

New from the creators of TechTasks.com: StatSheet.com