I'm trying to create a txt file for the reg query result which looks like this and works
REG QUERY HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C5E637C6-5AB6-426F-B638-7DC533AE5C75} /v InstallLocation > C:\file.txt
But I'm trying to only create the txt file if the reg query finds something.
@echo off
REG QUERY HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C5E637C6-5AB6-426F-B638-7DC533AE5C75} /v InstallLocation
IF ERRORLEVEL 0 > C:\file.txt
I know I'm doing it wrong. with the above, it does create the .txt but it's blank. I want it to post the result so in this case InstallLocation