Hi, I need help with suppressing an error REG not found from a loop. I know that I can redirect errors buy using 2>NUL. In the code section I have pasted,the 2>NUL part breaks the script. Any idea on what the correct syntax should be. The script does work without the 2>nul
for /f "tokens=1,*" %%a in ('reg query HKCU\Software\Microsoft\Office\12.0\Outlook\Setup /v First-Run 2>nul ^|find "First-Run"') do (set OutlookProfileReady=%%a)
if %OutlookProfileReady%==First-Run goto Endofloop
echo First-Run Registry Key found !