If you want to get the list of all hidden subfolders in a folder, you can run the below command.
dir /s /b /A:DH
Hidden files deletion
To delete hidden files from command prompt we can use Del command. For example to delete a hidden file named example.doc we need to run the below command.
del /A:H example.doc
Note that /A:H is necessary otherwise you will get ‘file not found’ error like below.
C:\>del example.doc
Could Not Find C:\example.doc
To delete all hidden files from a given directory we can run the below command.
del directory_path /A:H
Alternatively you can cd to that directory and then run the below command.
del * /A:H
To delete hidden files from subfolders also you can do that by adding /S switch
del * /A:H /S
Opmerkingen