6

If you want to make in command line in windows all files and directories non-hidden attrib -s -h * will not work.

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311
Alexey
  • 403

2 Answers2

12

You didn't mention which OS are you using, but since the command that you used

attrib -s -h *

didn't work, I'm guessing you used it without administrator priviliges.

The method I use is:

Run command prompt (Start -> Run -> CMD for XP, or for Vista and 7 Start -> type CMD in search box, right click and run as Administrator), type the following command:

attrib -H -S D:\yourfolder\*.* /S /D

This will remove the Hidden and System attribute of all files in the yourfolder folder on the D: drive.

The /S and /D arguments are optional.

/S will recurse down into all sub folders and

/D will unhide the folders themselves if they have the System or Hidden attribute set.

I regularly use this to clean customer virus infected flashdrives, as some viruses tend to hide your files and replace them with infected copies of the virus itself.

slavmaf
  • 434
0

For hidden files:

for /f "delims=|" %x in ('dir /a:h /b') do @attrib -h "%x"

For system hidden files:

for /f "delims=|" %x in ('dir /a:sh /b') do @attrib -s -h "%x"

These will affect all hidden (and system) files and directories in the current directory

Alexey
  • 403