how to use redirects ">" in batch - TechRepublic
Question
April 28, 2009 at 02:55 PM
knowledgebased

how to use redirects “>” in batch

by knowledgebased . Updated 17 years, 2 months ago

When using > or >> in a batch file I dont get the result I want.

For instance: ipconfig >> “C:\Documents and Settings\jbusby\My Documents\logs\ipconfig.txt”
saved as ipconfig.bat and run from cmd will append the batch file’s contents to the aforementioned file endlessly, rather than just redirect the results of command ipconfig.

I have the same problem with redirecting the results of a FOR command to a txt file.

I noticed that it adds a 1 in the front of the redirect symbols (ie it reads ” 1>> “)

Is there a symbol I should be using with the redirects since this is a batch file?

This discussion is locked

All Comments