Zend certified PHP/Magento developer

Batch script and get the output value of a found key

All works fine in a CMD prompt, but, I need put in a bat file to run, but cannot get the output of the Reg Query cmd, and then run another query from that.

Since what I am looking for is an App ID, and it can change, I need to find the rest of the key, the following in a command prompt gets me what I need:

REG Query HKLMSoftwareMicrosoftWindowsCurrentVersionUninstall /F "APP_NAME" /E /S

Gives me the needed key such as:

HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionUninstall{398E49A0-84CA-43B5-A926-42EF68619E91}

From there I can run another command to get the uninstall command:

REG Query HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionUninstall{398E49A0-84CA-43B5-A926-42EF68619E91} /V "UninstallString"

I have tried what I have been seeing on the site using for f token.... but it is not giving me just the first string, even with skip. Nor have I been able to assign it somehow. I need something like:

set Full_Key = reg query...
set Uninstall_CMD = Full_Key "/V Uninstallstring"

I know there will be only 1 entry, once it is found.