Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: NT services
This example for itemizing network services includes services such as EventLog, Schedule, and Spooler. These 3 don't have DisplayName values, but they are valid services.
This includes a check for a key that doesn't have a DisplayName, but does have an ObjectName. In this case, use the name of the key for the name of the service.
UNCServer=StrUpper(StrCat("\\"," Servername")) Server=RegConnect(UNCServer, @REGMACHINE) key=RegOpenkey(Server, "SYSTEM\CurrentControlSet\Services") svcs=RegQueryKeys(key) Count=ItemCount(svcs,@TAB) list="" For x = 1 to count dakey=ItemExtract(x,svcs,@TAB) if RegExistvalue(key,strcat(dakey,"[DisplayName]")) && RegExistvalue(key,strcat(dakey,"[Objectname]")) value=RegQueryValue(key,strcat("%dakey%","[DisplayName]")) list=strcat(list,@tab,value) endif if !RegExistvalue(key,strcat(dakey,"[DisplayName]")) && RegExistvalue(key,strcat(dakey,"[Objectname]")) value=dakey list=strcat(list,@tab,value) endif Next
Article ID: W13541
Filename: Itemize Network Services.txt
File Created: 2001:06:15:14:26:20
Last Updated: 2001:06:15:14:26:20