Creating invisible folder with batch

14,114

You need the attrib command to set the "hidden" attribute, assuming that when you say "invisible" you actually mean what Windows calls "hidden":

mkdir foo
attrib +h foo /s /d
Share:
14,114
user2065810
Author by

user2065810

Updated on June 06, 2022

Comments

  • user2065810
    user2065810 about 2 years

    How to use

    mkdir or md
    

    but make the folder invisible...

  • user2065810
    user2065810 over 11 years
    Could you yet explain what is +h, /s, and /d ?
  • user2065810
    user2065810 over 11 years
    And yes... by "invisible" I mean hidden... so only people with which turned on option in "Folder Options" can see it.
  • Vicky
    Vicky over 11 years
    run "help attrib" in a command prompt for more information. +H makes it hidden, /s recurses through the folder (and is needed for /d), /d applies to folders rather than files.
  • Andriy M
    Andriy M over 11 years
    Not sure what you are proposing with /s /d. attrib +h foo works perfectly fine (Win XP SP3, Win 7 SP1).
  • Vicky
    Vicky over 11 years
    @AndriyM Fair enough - I didn't know that!