I am learning about batch programming and I have got problem.
I want make a program which places the output of the dir
command to file.txt
.
What am I doing wrong?
ECHO OFF DIR > file.txt
I am learning about batch programming and I have got problem.
I want make a program which places the output of the dir
command to file.txt
.
What am I doing wrong?
ECHO OFF DIR > file.txt
Right now, you are writing "OFF DIR" into to textfile:
ECHO OFF DIR > FILE.TXT
You need to place these commands on two separate lines:
@ECHO OFF
DIR > FILE.TXT
The @ sign before ECHO OFF will hide that command from showing.