Show files hidden by a computer virus using command prompt

Edited by Michael J., Eng, Anonymous, Maria and 22 others

There are two common ways to unintentionally lose your valued computer files; either you messed them up or something else did. If you are certain you aren't the culprit, there is usually only one other cause - a computer virus. Before you panic at the idea of losing your files forever, you need to check to see if they are indeed lost or just hidden from plain sight.

This article will guide you through the process of restoring hidden files via Windows Command Prompt.

Was this helpful? Yes | No | I need help

Contents
Ad

Instructions

Open Command Prompt. There are actually a number of ways to do this. You can choose whatever method you prefer from the options below.
Click on the Windows Key (or Start button) and type in "cmd" in the Search Bar and hit Enter.
Cmd search bar.png

Click on the Windows Key (or Start button) and type in "run" in the Search Bar and hit Enter. A dialog box will appear. Type in "cmd" in the input field and hit Enter.

Cmd run dialog.jpg

Alternatively, you can press the Windows Key + R on your keyboard simultaneously. This is a shortcut method for invoking the Run dialog box.

Type "cd" (without the quotes) on the command prompt and hit Enter.
Cd cmd.png
Type the Drive Letter which stores the files you want to unhide plus a colon. Then hit Enter. In this example, we will try to navigate to Drive F:
Cd drive f.png
Type "dir/ah" (without the quotes). This will list all the hidden files in the current directory (Drive F:) and display them in the command prompt. However, this command does not restore the hidden files. This only allows you to check if your "lost" files are really lost, or just hidden inside the directory. If your files are indeed listed, then you can proceed to the next step to restore them.
Cmd dir ah.png
Type "attrib *. -h -s /s /d" (without the quotes) and hit Enter. This command will "officially" unhide the files hidden by the computer virus.
Cmd attrib.png


Note: The command prompt may seem unresponsive while the unhide command is being performed. This is normal, especially if there are a lot of files involved. Please be patient and wait until the blinking cursor resurfaces.

Was this helpful? Yes | No | I need help

Tips Tricks & Warnings

Questions and Answers

How to unhide file in PC from cmd?

To unhide a file on your PC using CMD, please do the following.

1. Press Windows key and R on your keyboard simultaneously, then type "cmd " without the quotes then hit enter.

2. Then type CD

"Directory of the folder where the hidden file is located" without the quotes, e.g if your hidden file is located in Documents folder type "CD
C:\Users\username\Downloads\Documents", then hit Enter.

3. Then type "attrib

Was this helpful? Yes | No | I need help

*.* -h /s /d " without the quotes then hit Enter to unhide
the files hidden in the folder.

4. That's it.

Note: If you are getting "access denied" reply, log-in as administrator on your PC.

See more questions like this: How can I find hidden viruses through cmd prompt and how can I tell an infected file from a normal file, besides being an .exe or autorun file?

How do I unhide my files, they were hidden by the virus but after the scan and removal of the virus?

My PC was infected with a virus which caused my files to be hidden. I used my anti-virus program to remove the virus. However, my files are still hidden. What can I do?

Once you have successfully erased the virus, you can easily unhide your files from the Windows control panel.

Follow the steps below to unhide your folders:

  1. 1
    On your desktop, click on the 'Start' menu.{
    Advertisement
    Was this step helpful? Yes | No | I need help

  2. 2
    Select 'Control Panel'.
    Advertisement
    Was this step helpful? Yes | No | I need help

  3. 3
    Click on the 'Appearance and personalization' option.
    Was this step helpful? Yes | No | I need help

  4. 4
    Select 'Folder Option'.
    Was this step helpful? Yes | No | I need help

  5. 5
    Click on the 'View' tab.
    Was this step helpful? Yes | No | I need help

  6. 6
    Now scroll down to the 'Hidden files and folders' section.
    Was this step helpful? Yes | No | I need help

  7. 7
    Select the 'Show hidden files' option.
    Was this step helpful? Yes | No | I need help

  8. 8
    Click on the 'OK' button.
    Was this step helpful? Yes | No | I need help

  9. 9
    Your files should now be unhidden.
    Was this step helpful? Yes | No | I need help

    Advertisement

If you're still unable to view your files, follow the instructions in our main guide.

If you need more help un-hiding your files, let us know in the Q&A section below.

See more questions like this: Hi sir good morning can you please help to remove the hidden virus on my windows8 loptap?

How to I find this virus and delete it?

My best friend sent me a link called 'your private video', with my name and I clicked that link, my browser crashed and I asked my friend what is that my friend said I don't know he clicked that link too. Every time I try to got to that website it says "danger this page contains malware that trying to steal my information such as passwords credit number etc " like this. Please help me !

Was this helpful? Yes | No | I need help

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

See more questions like this: I'm trying to find a virus that my anti-virus software isn't detecting?

How to remove the virus permanently?

I use McAfee antivirus even though I scan the drive, it produces the nill virus; but after also my system do the malfunctions like while inserting the pen drive it shows *.exe file and its dynamically changing the data. Please help for this. I have tried: I didn't try anything

Was this helpful? Yes | No | I need help

Antivirus programs do not see all types of threats. To cover the entire range of threats that can harm your computer, you will need to download the following programs:

After you download both programs, start with installing Malwarebytes' Anti-Malware. Let it update its databases and click the "Scan" tab. Insert your flash drive into your computer. Select "Threat Scan" and click "Start Scan". After it has checked the drives, reboot the system and repeat the same scanning procedure over again.

Was this helpful? Yes | No | I need help

Then, move on to Spybot: Search and Destroy. After installing it, right-click the icon in the system tray. Choose "Update". Click "Update" once new update files have been found. Then, close the window. Right-click the icon of Spybot in the system tray again. Click "System Scan". Click "Start a scan". After the scan has been completed, reboot the computer and rescan the system.

Was this helpful? Yes | No | I need help

See more questions like this: How to remove virus manually can you please help me?

What are the steps that I need to do to repair my computers booting time?

Hi I actually have an issue with the booting time of my Dell Inspiron 5000. It takes hours to restart. it will reboot then will go blank for a long time but the cursor is working and it shows that it is taking so long to restart and it will remain black screen. I tried the hard reset and the system restore, still doesn't work. What exactly needs to be done to make my computer work again? Why is this a recurring problem?. I have tried: Hard reset and system restore. I think it was caused by: Might be an a software or a virus but not sure.

Was this helpful? Yes | No | I need help

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

"CD drive join me" show on my window explorer left column directory listing?

Hi, I'm new to VisiHow, not sure how that works, but while searching net for why does "CD drive join me" show on my window explorer left column directory listing? And you popped asking how to be of help. Thanks for assistance as I have found virtually very little on the that subject across multiple search engine queries.

Was this helpful? Yes | No | I need help

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

See more questions like this: How to delete virus in my pen drive by cmd?

Hi how do I find hidden virus files on my laptop?

I had to contact a w\Windows team because my laptop came up with a blocked message. They explained the virus is a common virus and there are numerous errors in our hard drive. I have run many different scanners through our laptop with no hits on these errors nor the virus . So I was thinking it is a hidden folder, cookie or something as such. hope you can help!

Was this helpful? Yes | No | I need help

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

See more questions like this: I need help to find the files where the 2 Trojan are?

I don't find appearance and personalization option at control panel?

I don't find appearance and personalization option at control panel.

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

Access Denied in attrib. although I'm logged in as admin?

I saw you wrote when access denied log in as admin. The problem is I am the admin account and when I go to users in control panel it's blank. attrib -s -h *.* /s /d

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

See more questions like this: Access denied autorun.inf keeps appering when I try to unhide?

I want you to help me on how to delete unseen files on my PC?

My computer hard drive is 100GB but only 7GB is available, I checked the sizes of my files like documents, downloads, music, videos and all amounted to about 30GB and yet I don't know what is occupying my PC. Please I need your help on how to free my computer from the unseen files that are occupying my computer space

Was this helpful? Yes | No | I need help

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

See more questions like this: I have "s.yimg.com" & "conhost.exe" in my PC - can you help get rid of these?

Whenever I plug the pen drive, the data is hidden always?

%~@%~@%~@%~@ IndexerVolumeGuid. desktop.ini. above three files appear every time I delete them

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

When I inserted a Memory card to the computer in order to copy the files which were in a folder in the computer, the folder disappeared. I tried to scan with Avira antivirus but the folder has not been seen yet. What I need is to get my folder and contents back. Thank you, expecting your help.

How can I get the folder and its contents back?

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

See more questions like this: Sir I am usig antivirus but they are not detecting?

How does this virus work in my computer and how to change the attribute to resolve this issue?

Last week, my Pen Drive was affected by a virus, its action is like make all the folder shortcuts. I went to safe mode and removed the virus from pen drive but it made all folders hidden.

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

See more questions like this: How do I remove shortcut from computer (hard drive)?

There is an application called 505040, winmgr etc?

There is an application called 505040, winmgr etc. I have tried: Scan using SpyHunter and attrib. I think it was caused by: Internet virus

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

The method you posted is not working?

My pen drive is drive J:\. I tried your method by typing j in the start and then next attrib *. and so on. but it didn't work. The hidden files are very important, can you suggest me some strong method fast. I have tried: The method you have suggested on this website. The only difference is that instead of F directory I have done J directory because my files are in that. I think it was caused by: Virus

Was this helpful? Yes | No | I need help

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

See more questions like this: Update on Windows 7 not working?

Hi, just a quick question?

I've never been on this site before, do I have to pay for it?....

No, this is free of charge site. Please feel free to ask.

@VIRUS = HR is a nettlesome malware that breaks into your computer without any notification. ... This malware usually appears as a command prompt window with the message "YOU ARE A FOOL!! ... Therefore, it is highly recommended to get rid of @VIRUS = HR and the accompanying computer?

@VIRUS = HR is a nettlesome malware that breaks into your computer without any notification. ... This malware usually appears as a command prompt window with the message "YOU ARE A FOOL!! ... Therefore, it is highly recommended to get rid of @VIRUS = HR and the accompanying computer

Was this helpful? Yes | No | I need help

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

On CMD trying to see if there are affected files either virus or malware as computer functions are not all working when attempting to execute a command of internet explorer to perform a Microsoft safety scan.

On CMD trying to see if there are affected files either virus or malware as computer functions are not all working when attempting to execute a command of internet explorer to perform a Microsoft safety scan. I have tried: Difficult to do prefetch to delete as well as clean files. I think it was caused by: Virus

Was this helpful? Yes | No | I need help

VisiHow QnA. This section is not written yet. Want to join in? Click EDIT to write this answer.

Comments

VisiHow welcomes all comments. If you do not want to be anonymous, register or log in. It is free.




Wikifight23
Premier Author
21 Articles Started
250 Article Edits
11,715 Points
Wikifight23 is a premier author with VisiHow. Wikifight23 has achieved the level of "Gunnery Sergeant" with 11,715 points. Wikifight23 has started 21 articles (including this one) and has also made 250 article edits. 425,000 people have read Wikifight23's article contributions.
Wikifight23's Message Board
Wikifight23: Hi, my name is Wikifight23.
Wikifight23: Can I help you with your problem about "Show files hidden by a computer virus using command prompt"?
 

Article Info

Categories : Antivirus

Recent edits by: mgnonna, parthi, VisiHow

Share this Article:

Thanks to all authors for creating a page that has been read 31,754 times.

Do you have a question not answered in this article?
Click here to ask one of the writers of this article
x

Thank Our Volunteer Authors.

Would you like to give back to the community by fixing a spelling mistake? Yes | No