Reputation: 1196
I am trying to list all the files in a directory excluding the extension. I would like to output this into a txt file. I have managed to list all the files successfully.
@ECHO OFF
for %%a in ("c:\wamp64\www\blessd\final\*") do ECHO %%~na
This works fine and all the files in the directory are printed to the screen, however when I try output this to a txt file it does not work.
for %%a in ("c:\wamp64\www\blessd\final\*") do ECHO %%~na > test1.txt
Upvotes: 1
Views: 47
Reputation: 3667
You need to redirect the output of the bat file, not of a single output. If your bat file is My.bat
, try:
My.bat > this.out
Upvotes: 1