Cmd, Tutorial

Recovering Files on Flash Disk that were Hidden by a Virus

3 min read
There are many anti-virus software that take care of this.
However, I prefer to use the built-in Windows antivirus which doesn’t run too heavy and doesn’t take up too much memory.
The problem is that the built-in antivirus often just removes the virus and doesn’t fix the damage it has done.
In the following, I found out how to restore files on a flash disk hidden by a virus, using the built-in windows software, cmd.
There are many ways that can be done to restore data hidden by viruses, ranging from using third-party software, to manual methods (No Software) because it uses Windows built-in tools.
But this time I will not discuss third-party software, because in this discussion I will use an easier and safer way by using the built-in Windows tools.
For those who still want to find the software, please search for yourself on Google.
Actually, your file is still on the flashdisk, but it cannot be seen because the file attributes have been changed by the virus to Hidden, and Protected by Operating System.
To display the file, show hidden file/folder is not enough because the file is also protected by the operating system.
The steps that must be taken are as follows:
  • Open Control Panel and select Folder Option
  • A new window will open.
    Select the view tab
  • In show hidden files, select show files, folders, and drives.
  • Uncheck Hidden file protected operating system
  • A confirmation box will appear, click yes
  • Click Ok

 

At this point we can see the files and folders hidden by the virus.
Now try to copy the hidden file or folder to another place.
If the file / folder can be copied or moved, then the problem is over.
But if it cannot be copied or moved and cannot be changed to Unhidden, the next steps are as follows:
Create a *.bat file using notepad++ or you can also use the regular Windows notepad then enter this code:

attrib -s -h *.* /s /d

Then save it with the suffix *.bat, let’s say we name it file.bat and in the save as section, select all files. Remember, save the file on your flashdisk not on another drive, put it on the outermost page of the flashdisk (meaning not inside the folder on the flashdisk).
Run the.bat file by double-clicking the file and wait for the CMD window to close.
If the CMD window has closed, now your data on the flashdisk is no longer hidden and can be copied to another place.
I recommend that after copying the data, immediately format your flashdisk to remove the remaining virus components, who knows there are autorun files that have been modified by the virus.
Therefore, I recommend formatting the flash drive to be free from the remnants of a dangerous virus.
Additional Information:
After discussing how to change file attributes via CMD, surely you are curious about the Command command above?
Therefore I will discuss what the functions of the command above are.
attrib = is a command in the dos language to assign attributes to a file or folder.
-s = minus sign (-) means delete and the letter S means file system, so the meaning of the -s sign is to delete the protected operating system attribute.
-h = almost the same as the function above, the -h sign serves to remove the hidden attribute or change the file that was originally hidden to become visible again
*.* = Asterisk (*) means all, so what this command means is all files or folders that have all extensions
/s = This means processing all files in the same folder as the file.bat location as well as all subfolders within it
/d = commands to process folders as well, meaning that if we don’t write this command it will only process all files without processing folders.

Leave a Reply

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

× Chat