Hello everyone,

I'm just trying to figure something out and maybe you could help. I have made a script that works 100% as a .BAT file on the target PC. I just pasted the same script into the Post-Distribution script area, using engine C:\Windows\System32\CMD.exe /C and script type .BAT

Whenever I include this particular line, it doesn't get executed and every instructions after are ignored:

FOR /f "delims=" %%a IN ('REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Ins taller\UserData\S-1-5-18\Products\2477E1F55C6E19342AAE916706DC2988\Insta llProperties ^|find /i "LocalPackage"') DO SET OLDGW=%%a

Basically I'm trying to read a specific subkey value and put it into a variable. It's a HKLM key so the Zen (SYSTEM) user should be able to read from it... So why it doesn't work?