Loading ...
Sorry, an error occurred while loading the content.

Re: [BATCH WORLD] for loop including hidden files

Expand Messages
  • foxidrive
    ... Yep, precisely. ... Your welcome.
    Message 1 of 17 , Aug 31, 2011
    • 0 Attachment
      On 1/09/2011 02:54, Marc Peterson wrote:
      >>> Batch world group,
      >>> Any ideas how to include hidden files in a for loop? Most commands
      >> (FOR,
      >>> DIR, etc.) exclude hidden files, obviously.
      >>> I thought I was onto a workaround with something like this:
      >>> for /f "tokens=2 delims=:" %%I in ('attrib *') do @echo %%I
      >> Try this:
      >> for /f "delims=" %%a in ('dir /b /a:-d ') do @echo %%a
      > Oh, wow, I was really over-thinking it and missing the obvious.
      > Still, though, I don't think I would have found that solution myself because
      > I've never fully grasped the /a:-d type switches. I guess it means exclude
      > _only_ directories while including all the other DIR attribute options (R,
      > H, A,& S).

      Yep, precisely.

      > Thanks!

      Your welcome.
    Your message has been successfully submitted and would be delivered to recipients shortly.