Question : Redirection in batch file

For example
The command line  dir>mydir.txt works fine but if i put exactly the same line in a batch file (because I want to use variables like %1) it will work but display a strange output:

ie. "dir   1>mydir.txt"

(and dirmydir.txt")
and dir>>mydir.txt will be ok,

Answer : Redirection in batch file

Thats fine.  > is effectively 1> but when you add a parameter like %1 then dir %1>mydir.txt will become dir % 1>mydir.txt so what you want is dir %1 >mydir.txt !


Steve
Random Solutions  
 
programming4us programming4us