Recently, I used xcopy to backup all the files from a bad hard drive to another drive under Windows XP. After all the files got copied, the directory is hidden and cannot be seen. I tried to use attrib.exe to remove the hidden attribute, however the command warned me that the directory's system attribute is set and I cannot change it.
H:>attrib -h enterprise Not resetting system file - H:enterprise H:>attrib -a enterprise Not resetting hidden file - H:enterprise H:>attrib -a -h enterprise Not resetting system file - H:enterprise
I then tried to read the online help. It turns out I need to specify the /s and /d switches, too. So, the command should be used like this.
H:>attrib /s /d -s -h enterprise
This post may contain affiliated links. When you click on the link and purchase a product, we receive a small commision to keep us running. Thanks.
There is a ‘system’ attribute that is also available with file properties. You must remove that attribute if you want to change the hidden attribute.
You do not have to use /s /d switches unless all files and subfolders are hidden and system also.
In your third example, changing -a with -s would have worked.
H:>attrib -s -h enterprise
Thanks for your input. I have tried the command without /s /d, but it didn’t work for this particular directory. I’ll try it again next time I ran into the same problem.
is there any command like attrib but in linux? so i can change windows hidden file attribute using linux
Missing a basic functionality that’s been around since DOS 3.0, eh?
Cry me a river.
You can GET a program that will allow you to do this, but like everything else linux it requires jumping through 10 hoops (the last covered in flaming dog poo) and, of course, 4x the time the entire process would take on a WinPC, Mac, EVEN OS/2!!!!
For real: You want a cheap (free) operating system, you get one…
I don’t know if such command exists under Linux. Sorry.
A bit late to the commenting, I suppose, but mtools (short for MS-DOS Tools) is just the thing baskoro is looking for. It includes a mattrib command for manipulating the attributes. I used to be quite fond of using it with a script to save all filenames and attributes to a text file, remove all the system and read-only attributes, switch over to Windows, do a _really_ complete defrag, then back to Linux to restore the attributes as they had been with another script. I’m not dual-booting these days, and don’t have the scripts handy, or I’d offer them as well, in case they’d be of interest. But, at least mtools does have what you’re looking for.
Added afterthought: I don’t know whether, or how well, it handles NTFS. But I know FAT32 is a piece of cake for it.
Thanks for the great info. It’s never too late to comment. The future reader can still benefit from your input.
Thanks dude , I know it bit late but your info help me gr8.
Thanks and keep helping.
When I use attrib /S /D -s -h only the attribute of the this folder get changed. The sub-folders are not changed.
May be due to a virus the attributes of all my folders on my pendrive have changed to System/ Hidden.
Any suggestion. Thanks.
Thank You , Very …. Very … Much
This command file has changed me : setupp.exe ( attribute +h +s by trojan.win32.agent)
Thanks budy it works, 100% there is no any if & but. Thanks.
That worked, thanks.
Great… Thanks a lot…:)
Great….ton of thanks 🙂
Really the below command is working for XP
H:>attrib /s /d -s -h [enterprise]
enterprise – folder name… can be used as [*.*]