I can't find a command or simple batch of commands to recursively remove the "Hidden"-Attribute from files and directories. All commands like "attrib" and "for" seem to skip hidden files. E.g.:
attrib -H /S /D /L mydir
doesn't do anything at all, because it skips all hidden stuff. Does someone know how to do this with standard Windows tools?
This question is related to
windows
batch-file
cmd
For example folder named new under E: drive
type the command:
e:\cd new
e:\new\attrib *.* -s -h /s /d
and all the files and folders are un-hidden
To launch command prompt in administrator mode
attrib -h -r -s /s /d "location of the drive letter:" \*.*
if you wanna remove attributes for all files in all folders on whole flash drive do this:
attrib -r -s -h /S /D
this command will remove attrubutes for all files folders and subfolders:
-read only -system file -is hidden -Processes matching files and all subfolders. -Processes folders as well
To make a batch file for its current directory and sub directories:
cd %~dp0
attrib -h -r -s /s /d /l *.*
just type
attrib -h -r -s /s /d j:*.*
where j is the drive letter... unlocks all the locked stuff in j drive
if u want to make it specific..then go to a specific location using cmd and then type
attrib -h -r -s /s /d "foldername"
it can also be used to lock drives or folders just alter "-" with "+"
attrib +h +r +s /s /d "foldername"
You can't remove hidden without also removing system.
You want:
cd mydir
attrib -H -S /D /S
That will remove the hidden and system attributes from all the files/folders inside of your current directory.
Source: Stackoverflow.com