Locutus_NYC
asked on
BATCH FILES: When sending output to a file, >> becomes 1>>. Why?
Im making a batch file in DOS and trying to put >NUL or >>(filename) at the end of lines but when I run it and see the output it comes out wrong...
>NUL becomes 1>NUL and >>(filename) becomes 1>>(filename).
These 1's are wreaking havoc on my scripts.. anyone know why this is happening?
>NUL becomes 1>NUL and >>(filename) becomes 1>>(filename).
These 1's are wreaking havoc on my scripts.. anyone know why this is happening?
[These 1's are wreaking havoc on my scripts]
How so? What kind of scripts are you referring to?
How so? What kind of scripts are you referring to?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Sorry all.. turns out it was a permissions issue on the share where the script was kept... which was causing the errors. I assumed it was due to the 1's being present in the output... but once the perms were fixed, the 1's didn't matter.
Again, sorry for the dumb moment.. and thanks for your help.
Again, sorry for the dumb moment.. and thanks for your help.
dir 1>nul
1 indicates stdout, whereas 2 indicates stderr:
dir \\server\share 2> err.out
If the server can't be found, the error message will be sent to err.out