I’m trying to read a registry key value and use it within a variable latter on in the program however my registry key contains spaces and now I cant get it to work, dose anybody know hoe to process keys with spaces?
for /f "tokens=3" %%a in ('reg query "HKEY_CLASSES_ROOT\Software\VTS\TREADSTONE LT\Main" /v EXECUTE ^| find /i "REG_SZ"') do set UserNm=%%a
MSG * %UserNm%
pause
I’m using Windows batch.
To use double quotes you need to use
usebackqin yourforloop and change your'‘s to back ticks.