strComputer = "."
Set wshShell = Wscript.CreateObject( "Wscript.Shell" )
strServer=wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%")
Set fso = CreateObject("Scripting.FileSystemObject")
Set file = fso.CreateTextFile("service_list_" & strserver & ".txt", True)
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Service ")
For Each objItem in colItems
Wscript.Echo objItem.displayName & "," & objItem.Startmode & "," & objItem.startname
file.WriteLine objItem.displayName & "," & objItem.Startmode & "," & objItem.startname
Next