Submitted By: Umesh Chandra Thakur

Displays all services whose startup mode is set to Automatic.

Visual Basic
Edit|Remove
'------------------------------------------------------
'List all services that are set to start Automatically
'By: Umesh C. Thakur (ucthakur@hotmail.com)
'------------------------------------------------------

strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

wscript.echo "SERVICES SET TO START AUTOMATICALLY:"
wscript.echo "------------------------------------"

Set colItems = objWMIService.ExecQuery("Select * from Win32_Service where startMode='Auto'")

For Each objItem in colItems
    Wscript.Echo objItem.Name & " (" & objItem.displayName & ")"
Next

wscript.echo "Total Auto-start Services: " & colItems.count