Forum posts for services.exe

How to read a REG Value into an Environment Variable

I am trying to read a REG Value into an Environment Variable in a BAT file. E.g.,

REG HKLMSYSTEMCurrentControlSetServicesEventlog /v ImagePath

I can get the entire output string of the REG command into an environment variable like this:

FOR /F 'usebackq delims==' %%a in (`REG QUERY 'HKLMSYSTEMCurrentControlSetServicesEventlog' /v ImagePath`) DO set ImagePath=%%a


However, this sets the environment variable to the entire line, i.e.,

ImagePath REG_EXPAND_SZ C:Windowssystem32services.exe


I want the Environment Variable to consist only of the path portion, i.e.,

C:Windowssystem32services.exe


Thanks for any tips.

View complete forum thread with replies

Other posts related to services.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

how to change the way explorer.exe and service.exe is started up to edit process affinity?
Why is services.exe changing the Event Log retention policy?
difference between process explorer and task manager [closed]
In windows programming, is there any way we can find out which module (Thread ID & DLL) is c…
CeSetUserNotificationEx with named event and CNT_TIME fails under services.exe
How to read a REG Value into an Environment Variable
Hooking Protected Processes

What is the carbon footprint of your coffee?

Is it low? Is it high? Can this things really kill the planet Earth? Maybe the answer will surprise you. Maybe not.