in reply to WindowsRegistry{ServiceName} V.S. wmic{ServiceName} UPDATE: Solved

I'm afraid I don't know much about wmic; but if, as you say, you are "looking for some way to get the registry service name", you can try using: `sc query`.

This will return information similar to this:

SERVICE_NAME: WSearch DISPLAY_NAME: Windows Search TYPE : 10 WIN32_OWN_PROCESS STATE : 4 RUNNING (STOPPABLE,NOT_PAUSABLE,ACCEPTS_SHUTDO +WN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 SERVICE_NAME: wuauserv DISPLAY_NAME: Automatic Updates TYPE : 20 WIN32_SHARE_PROCESS STATE : 4 RUNNING (STOPPABLE,NOT_PAUSABLE,ACCEPTS_SHUTDO +WN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0
You'll have to scrape the output for the SERVICE_NAME, but it may be what you need.

Good luck!

Replies are listed 'Best First'.
Re^2: WindowsRegistry{ServiceName} V.S. wmic{ServiceName}
by cmv (Chaplain) on Sep 19, 2007 at 13:24 UTC
    Thanks perlofwisdom for the reply. I've never used the sc command before, and it was interesting to learn about it. However, I don't think this helps with the current problem, since all of the service names that show up in the sc command look "normal" (Wmi, WinVNC4, etc).

    I'm looking for a service name in hex, of the form 8BAA28BF-8565-43BE-81C0-E7BBD94187D3, which is stuff that looks like it comes out of the windows registry (I could be wrong on this, I'm hoplessly confused by windows musty innards). I need this type of service name, so I can use Win32::File::CreateFile() on it to create a device file, so I can do an IOCTL on it, to speak directly with the currently running device driver, to have it dump out the permanent MAC address of the hardware, and the current MAC address that the device driver is using (they can be different). Whew...

    Excruciating details on this whole effort can be found in id:639048

    Putting the question another way. How can I get the hex service name of a device, without knowing the hardcoded $dev value in my example script?

    Thanks

    -Craig