1

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

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.