1

I was looking at this post: Is there a way to batch rename files to lowercase?

and I tried to use it in a textfile, renaming the extention into .bat, then running it at the directory. But, the title error popped up, and nothing happened. Any guesses on why this is happening?

Piofmc
  • 33

1 Answers1

1

Using the FOR command in a batchfile works slightly different, because batchfiles themselves use %? variables. For that reason the FOR command requires its parameter to be %%? to work.

If you enter FOR /? from a commandline, the help will tell you this as well.

So the following FOR command would be the following in a batch file:

in cmd:

for %i IN (*.*) DO echo %i

in file.bat:

for %%i IN (*.*) DO echo %%i
LPChip
  • 66,193