How to recover a hidden file using MS DOS command

This article will help to recover the hidden file which goes hidden when the file get affected by virus. Such type of files can be cleaned by antivirus but some files cannot be recovered from hidden status. By using MS DOS command, the hidden files can be recovered to its original position. Even we cannot able to recover in Windows, we can recover using MS DOS command.


The files can be go for a hidden status by manual or by a virus affect. If the file is set as hidden by manual, we can recover by clicking Tools – Folder options – view – show hidden files and folders. This kind of setting will help not to share a particular folder or file to another user. Due to virus affect, some files or folders will go for a hidden status. After cleaning the virus also, there are chances of some files and folders will remain in hidden status. Using MS DOS command, we can recover that kind of hidden files and folders to normal visible mode.

Virus problem in pen drive and memory card

When we using Pen drive or memory card to store data in a computer, there are chances of virus affect. There are some virus which will create the same name of that particular folder or file in the drive and it will hide the original file and folder. So if we click that virus folder, there will not be any files or content. So we will assume that the pendrive or memory card is affected by virus and we will format the drive. But the fact is, the files will be there in the drive but with hidden status. If we check the memory of the drive, it will show used memory but the files or folders can not be visible. Even if we apply the setting to show hidden file under the Tools menu to change the status, we cannot see the file or folder. Now we will see how to recover hidden files and folders by using MS DOS command.

Executing command to recover hidden file or folder

'Attrib' is the command name to recover the hidden file. 'Attrib' is short form of Attribute. By using attrib command, we can set or remove the status as hidden or read only or system file. We will see how to use Attrib command to recover the file.

Steps to recover hidden file or hidden folder

As I mentioned that Attrib is a MS DOS command, so we have to go command prompt.

Click start
click Run
Now type: command

A screen will appear which is called DOS prompt. Now you will see c:/folder name. Now type the drive name which you want to change the status of folder or file. For example, if you want the change the status of file or folder in your pen drive, type g: or f: which is assigned to pen drive. Now you will see the drive letter in the prompt. If you want to see the hidden files in your pen drive, type: dir / ah. It will list all the files and folders which are in hidden status. You can remove the hidden status one by one by using the following command.

Type the following:

Attrib –s –h –r filename

suppose the file name is 'docwrite'
Type the following.
Attrib –s –h –r docwrite

'-s' is used to remove the status of system file
'-h' is used to remove the status of hidden file
'-r' is used to remove the status of read-only file

After the above command is executed, the specified file will be recovered from hidden status. You can check this in the Windows screen. Like that each and every file can be changed from hidden status to visible mode.

Suppose there are chances that a particular folder will be in hidden status. The command dir /ah will list all the hidden files and folders, note the folder name and type the command as mentioned above by giving the folder name. For example, the folder name is 'helpdir', now type the following:

Attrib –s –h –r helpdir

This will change the status from hidden to normal visible mode. Thus any file or folder can be changed to normal visible mode.

Steps to hide a file or folder using MS DOS command

This Attrib command can be used vice versa also. I mean you can change a file or folder to hidden mode. Type the following command to change the file or folder to hidden status.

Attrib +h Filename

Attrib +h docwrite

Now the 'docwrite' file will be in hidden status. You can see the status of all files in a particular folder. Type 'attrib' in a particular folder or file. It will list all the files with the status. If it is a system file, it will show 'S', if it is a hidden file, it will show 'H'. If it is a read-only file, It will show 'R'. Like that we can know the status of a file.


By using this Attrib command, we can remove the hidden status and read-only status in the MS DOS prompt. This will help when a file or folder is affected by virus. So without formatting, we can recover our hidden file and folder back to normal visible mode.

Related Articles

How to prevent acne scars?

This article explains various measures which keep acne under control. This decreases inflammation and consequently chances of formation of acne scars too decreases. Actions like not picking at skin, proper hydration, using sunscreen lotions, proper skin care regime etc prevent formation of acne scars.

How To Control Anger?

Have you ever been angry and later on felt sad for being angry on some one or something? Do you want to control your anger ? Is anger good or not ? The following article will discuss about anger and measures through which we can control our anger.

How to remove blood stains from delicate fabrics and specific surfaces?

This article explains various tips and methods to get rid of blood stains from delicate fabrics like silk, satin, woolen, linen etc and from specific surfaces like concrete, hardwood floors, mattress, quilt, leather, carpets etc. These methods used can make them free from blood stains.

Top 9 tips and exercises to sharpen the mind and boost brainpower

The brain needs constant stimulation to remain alert and active. Practice good habits that can sharpen your memory and help you stay alert and on top of your game at all times. Simple lifestyle changes that involve the number of you sleep or what you eat or how you relax can play a great role in how your brain functions. Find out what you need to do right, to get the best out of your grey cells.

How to become a pathologist with top hospitals in India

Are you looking for a career in medicine as a clinical pathologist? Need to know how to start a pathology lab? This article provides complete information on the different specializations in pathology and a career guide on starting a career as a pathologist. You will also get a general idea on the approximate costs of setting up your own path lab.

More articles: How to


Author: Deepak Yadav15 Jul 2011 Member Level: Gold   Points : 1

You can also use attrib +h +i filename to hidden a specify file and if want to unhide you use attrib -h -i filename .

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: