FOR command cannot see hidden files
- by Synetech
I’m struggling with one of the most frustrating bugs I’ve ever come across.
Bug description:
The for command of the command-interpreter cannot see hidden files.
Reproduction steps:
Create a temporary directory
Create a few files
Assign a variety of attributes to the files (including hidden)
Use a command like for %i in (*) do echo "%i"
Expected results:
All files are processed in the for loop either by default or though a switch.
Actual results:
Files with any attribute other than hidden are processed; files flagged as hidden are skipped
There is no switch to the for command to allow it to process hidden files
Implications:
There is no way to process all files from the command-prompt.
Question:
How the heck can hidden files be processed from the command-prompt or batch-files (at least in Windows if not DOS)?