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
Author by
user2065810
Updated on June 06, 2022Comments
-
user2065810 about 2 years
How to use
mkdir or md
but make the folder invisible...
-
user2065810 over 11 yearsCould you yet explain what is +h, /s, and /d ?
-
user2065810 over 11 yearsAnd yes... by "invisible" I mean hidden... so only people with which turned on option in "Folder Options" can see it.
-
Vicky over 11 yearsrun "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 over 11 yearsNot sure what you are proposing with
/s /d
.attrib +h foo
works perfectly fine (Win XP SP3, Win 7 SP1). -
Vicky over 11 years@AndriyM Fair enough - I didn't know that!