Is there a command on the Windows command-line that can list hidden folders?
I've tried dir -a:dh but that doesn't work for me.
Is there a command on the Windows command-line that can list hidden folders?
I've tried dir -a:dh but that doesn't work for me.
Use the following command:
dir /a:hd C:\folder\
The difference between what you were typing and this command is that you were using a - to indicate the switch, not a /. In most windows command line applications, this doesn't matter, but in the case of the dir command, you must use a slash, not a dash.
The /a switch changes which attributes are displayed. h shows hidden files and d shows just directories. Make sure you keep the trailing slash on the end of the folder path. I just tested, and it worked fine.
dir/a should show hidden folders.dir /a:d shows all directories.dir /a:h shows all hidden files.Try dir /adh (without the colon) to combine.
dir /ad (as opposed to dir /ad-h and dir /adh), what's the default h behavior?
– Pacerier
Apr 25 '15 at 20:29
To list all files and folders, including hidden and system ones, use dir with /a flag:
dir /a C:\
/a without specifying any attributes, the command dir displays the names of all files, including hidden and system files. from https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/dir
– cachius
Sep 21 '23 at 07:49
:character in/a:hd? Omitting it and simply doingdir /ahseems to work well.... – Pacerier Apr 25 '15 at 20:24dirdisplay all files folders and the attributes of each item? – Royi Jun 29 '17 at 18:33cmd.exeit works as advertised (and doesn't work in, eg, a VS Code Powershell terminal). More info.cmd /r dir /ais a neat workaround. – ruffin Jun 14 '22 at 19:13