What does the "^" do in this string: /b /a:-d /o:-d 2^>NUL ?
Actually, the entire string, to be more fair is: for /f "skip=10 delims=" %%a in ('dir *.tib /b /a:-d /o:-d 2^>NUL') do del /q "%%a"
And, a more complete question would be what does "2^" mean in that snippet?
Thanks.
The ^ (caret) symbol is mandatory when you code a special character like the > redirector as part of a command used as FOR /F clause. 2>nul (2^>nul in the reported case) redirects stderr (2) to the nul device so erasing any error message to the screen (in the same way 1>nul suppresses any result line to the screen).
This to force the DIR command to run silently even if no files are found since the command output is piped to DEL by the FOR statement but the error messages are still directed to screen since stderr is different from stdout.
Anyway this has nothing to do with DOS that doesn't exist in Win 7 as NT kernel based. This is NT batch and what you believe to be the DOS command prompt actually is the NT system console.
| « client server multi-threa... | [Solved] I SIMPLY want to download... » |