Tech Tips Home
The Best Tech Tips And Daily Deals
Newsletter On The Internet!

WorldStart Tech Tip And Store Search
Email: Password: Login Remember Me
looking for freeware

Like what you see here? Subscribe to the Tech Tips newsletter!   Email: Subscribe

Using the Command Prompt to Reveal Hidden Files

Monday, November 7th, 2011 by | Filed Under: File & Disk Management, Security Help

Some viruses leave behind nasty side effects, even when your antivirus program has cleaned the actual virus from your computer. If your desktop icons are missing and your C: drive appears blank, don’t panic — your files haven’t gone permanently AWOL. Common viruses, such as the Windows 7 Recovery virus, will hide your files in an attempt to coerce you into paying for the virus’s removal. When you view your desktop or click on your C: drive, it may appear that all of your files have been deleted, but they haven’t — the virus has simply hidden them. You can restore them easily using a simple command prompt trick that works in Windows XP, Vista and 7.

Click the Start button in the lower left corner of your task bar. Type cmd in the search box at the bottom of the menu and press Enter. If you’re using Windows XP, click Run and type cmd into the Run box.

You will see this screen:

Command prompt

Type attrib -s -h -r c:/*.* /s /d and press Enter to execute the command. The command prompt window should look like this after you’ve typed the command:

Command prompt after entering the command

Allow the command to finish executing (it may take a few minutes). When it’s done, close the command prompt window and check your desktop — your files, hidden by the virus, have been restored. You can use the same trick to restore files the virus may have hidden on other drives, including removable storage such as flash drives and external hard drives; just change the drive letter in the command above to the drive letter of the storage device with the hidden files.

~Jacqui Frye

Tags: , , , , , ,

67 Responses to “Using the Command Prompt to Reveal Hidden Files”

  1. Al says:

    Thanks, great tip.

  2. Michael says:

    Thank you so much for the help. Lifts my spirits to know there are good people out there.

  3. Aki Zain says:

    Thank you very much for the help…..

  4. KULAS says:

    !!!!!!my files were deleted already!!!

    thanks but it too late!!!damn!

  5. sunG says:

    tnx for the tip it really help me a lot…

  6. Vouthea says:

    Thank for show this command

  7. zatunand says:

    thnx a lot

  8. rydla says:

    awesome solution.

  9. Nitu says:

    Thanks. Very helpful..

  10. rakesh says:

    this didn’t help me :(
    my files hidden in c drive not in any folder and its not coming up aftr doing this method also…

  11. Tezz says:

    Thank you m files were restored but only as chk files. Isn’t there an option to restore them to their original formats?

  12. Rempa says:

    What does each symbol mean? What exactly are you commanding the computer to do? For instance, what does -s, -h, and -r mean? I know your trying to make the C drive uncover all hidden files, but it looks like your using multiple commands to do it. Any help would be appreciated! =)

  13. James says:

    my files in pendrive are totally hidden . neither it can be shown from the folder option. i could realize only from, the space in drive is occupied

  14. maricel says:

    thank you your tips really help alot!!!

  15. fajri says:

    nice solution..thanks

  16. martin says:

    I tried the command to recover lost files but all I get access denied on everything y is it doing that? what am I doing wrong?

    • audra says:

      Try using Command Prompt as administrator. When you type cmd in the search, look for Command Prompt at the top of the Start Menu. Right click on the name, then choose Run as Administrator.

      • Martin says:

        Thank you very much! It really worked. Your my hero. I got another question, I went to another site, and this is exactly how they explain it. Go to command prompt window and type: Start/Run and type in: CMD CD\Recycled\ next type DIR. All i get is invalid switch -“/Run”. Can you please explain exactly how to type all that so the computer can understand. the way you explain it is awesome. I really appreciate your help. Thank You for your time and consideration. God bless!

  17. Martin says:

    oops wrote it wrong. go to command prompt and type: Start/Run and type in: CMD CD\Recycled\ next type DIR.

  18. Martin says:

    in between Recycled and DIR, Im suppose to type in name of the sub folder.

  19. Ishmael says:

    Even though I ran cmd as administrator I still have everything denied. Why would that happen?

Leave a Reply

Like these tips? Get them for FREE in your email!

WorldStart's Tech Tips Newsletter

  • Tech Tips Daily - Become a tech pro! Get the very best tech and computer help sent directly to your email every weekday!

  • Tech Tips Weekly - If you don't want our Tech Tips newsletter every day, then sign up for this weekly newsletter to get the best information of the week. Sent on Fridays.

Other Newsletters

  • WorldStart's Daily Deals - Every week, we send out great deals in our Daily Deals newsletter. Many of these deals are exclusively for our Daily Deals newsletter subscribers and can't be found with our regular specials.

  • Just For Grins - Each issue includes a couple clean jokes, some funny quotes, and a hilarious reader's story. Newsletter is sent five days a week.

Enter Email Address:


Your e-mail address is safe with us!
We only use it to send you the newsletters you request. It is NEVER disclosed to a third party for any reason, ever! Plus, if you decided you don't like our newsletters (don't worry, you'll love them), unsubscribing is fast and easy.

Free Newsletter Signup

Tech Tips Daily

Become a tech pro! Get the very best tech and computer help sent directly to your email every weekday!

Tech Tips Weekly

The week's best in tech and computer help. Get your issue sent to your email every Friday!

WorldStart's Daily Deals

The very best deals on the Internet! Get a new set of incredible sales every day of the week!

Just For Grins

Clean jokes, funny quotes, and hilarious comics. Sent 5 times a week straight to your email.


Love Worldstart? Refer A Friend!

looking for freeware
WorldStart's Premium Membership

Tip Archive