Tuesday, December 27, 2011

Unhide Files in Virus Infected Pendrive Using Command Prompt

One sure way to retrieve your file or folder attributes back to unhidden is to use command prompt in windows. All you have to do is described below in steps.

Plug your pendrive to USB port of your computer. Make sure it is detected.


Start command prompt by Click Start>>Run and type cmd then hit enter.

Find the drive letter for the conected USB drive. For example, G:
In command prompt, type G:
Then type
attrib -s -h /s /d *.*

Make sure that you put space between each elements in the code.
hit enter, wait a moment and this should unhide all your files on your pendrive. Checkout the screenshot for more to clarify.

How to view hidden folders:

  • Click on Start –> Control Panel –> Folder Options.
  • Click on the View Tab and check the radio button “show hidden files and folders” and press OK.
  • This will enable you to see the hidden file.

By using DOS Command – attrib:You can do the same with DOS command also at Command Prompt. Here, We will use the DOS Command “attrib” to accomplish the same task.

  • Click on Start –> Run –> cmd
  • For example, I have a directory called “Perl” in root directory and I want to hide that directory with the help of attribute command.
  • Change the directory one level back to the directory you want to hide.
  • Type attrib +h Perl and hit Enter. That’s all, Perl folder is hidden now. You can type dir on the command prompt and you will not see Perl there in root directory.
  • Type attrib –h Perl to unhide the folder.

Little more about attrib: attrib is a DOS command to change the attribute of folder and files at command prompt. + and – are used to set and clear the attrib respectively.
Avaialable attributes are:

  • R – Set the file Read-Only
  • A – Set Archive attribute to files.
  • S – System file attributes
  • H – Hidden file attributes.



  1. thanks man 100% working.................

  2. Thank u so much, it help a lot....

  3. Work with my pen drive and external hard drive.

  4. YOU CAN SEE THIS POST: http://goo.gl/9WhfQo

  5. Thanks alot..
    I have create bat file to make it automated :)

    set /p dname=Please enter the USB Drive letter:
    attrib -s -h /s /d *.*

    Just paste it in notepad and save it as .bat then Enjoy :)

  6. Hi dear Bro,
    Thank You very much for your nice help. Your article is nice and described. Actually this is what I was looking for. It worked fine. I wish to always come back here, and learn something more from you.

  7. thank u so much........... its working

  8. visit the below link for step by step tutorial: