1.

Solve : Batch file inserts a charcter?

Answer»

I've created a batch file that copies all network DRIVES into a text file for me. If I TYPE each line into the command PROMPT individually, it works. However, if I RUN the batch file it inserts a character in the command line which causes the command to crash.

The line 'net use | find ": \\driver\folder" > c:\share.txt' becomes 'net use | find ": \\driver\folder" 1>c:\share.txt'

Is there a way I can stop this?The extra 1 you see is not really an extra character. When the interpreter PARSES your code, the extra character you see represents which data stream the output is directed to.

1 = STDOUT
2 = STDERROR

Hope this helps.



Discussion

No Comment Found