How-to: Change file attributes in Windows 7

We often find some troubles with flash memory viruses like the following. It’s usual to find a virus that hides folders in our usb flash drive and creates an exe with the same name. If we use antivirus like ESET Nod32, it will automatically delete the infected executable (name_of_folder.exe) but it will not recover the original folder attributes, so the original folder will still be hidden.

The problem comes when sometimes the Windows Explorer doesn’t let us change the file/folder hidden attribute in the file/folder properties.

To solve this we just need to go to the Start menu and write “cmd” in the search box, then hit enter.

It will appear the command line, now we have to write the drive letter assigned to the usb flash drive, in my case it’s G: and then hit enter.

Now that we are in the usb flash drive, we’ll proceed to change the file/folder attribute with the “attrib” command. The syntax of this command is “attrib [parameter] name_of_file” where “parameter” can be + or – (depending if we are going to add or erase and attrib) plus the letter of the attribute (R for read-only, A for archive, H for hidden and S for system). In our case we will write “attrib –H name_of_folder” to erase the hidden attribute of that folder.

And that’s it, now we have regained total visibility of the folder. We can do the same with all the other folder or files.

You can also create a test folder with useless files to practice playing with the attributes. Learn to use them, they’re very useful.

July 26, 2010 | Autor: Carloswaldo | Windows 7
Etiquetas: , , ,


  1. shartelier says:

    i can not format my flash which is write protected. I can possibly change the attribute even using the command prompt. Any ideas!!!!?

  2. FJ says:

    you need to enable the system attribute, just disabling the hidden attribute will give you a message similar to “the file system couldn’t be restored”
    So if you have a flash drive that had a virus and all your folders are hidden, you need to do this inside the root drive letter of the flash drive:
    attrib -H -R +S /D /S *

  3. Electron says:

    it worked great !!!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>