If you want to make in command line in windows all files and directories non-hidden attrib -s -h *
will not work.
-
2Before you do this, are you just trying to view the hidden files in Explorer? If yes, you only need to edit a setting in Windows Explorer... not permanently discard the hidden setting of files! (Folder options > View > Show hidden files, folder and drives / Hide protected operating system files)– ADTCSep 15, 2013 at 19:45
-
@ADTC Notice the self-answer.– userSep 15, 2013 at 19:46
-
1Yes, just want to warn the asker that his command line script will permanently discard the hidden and system attribute for all files on his disk, whereas the options I mention will simply show these files in Explorer. It really looks like he just wants to see the files, not actually change their attributes to visible/non-system (I would consider changing them system-wide a very bad thing to do).– ADTCSep 15, 2013 at 19:48
-
1Is this a question?– Ƭᴇcʜιᴇ007Sep 15, 2013 at 20:01
-
possible duplicate of How can I recursively clear the "Hidden" file flag on Windows Vista?, Windows: How turn off hidden attribute for all files and directories on a drive?– Ƭᴇcʜιᴇ007Sep 15, 2013 at 20:03
2 Answers
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.
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
-
2