Windows-10 virus

How to Remove Virus Using CMD in Windows 10 and 11

How to Remove Virus Using CMD in Windows 10 or 11. You can remove virus from your infected Drive or USB using CMD. Most virus create shortcut or super hide all data’s or change index path of data in drive. follow below steps to remove viruses from your computer drive or Flash Drive.

Step 1. In the search bar, type CMD then right-click on “Command Prompt” and choose “Run as an administrator”.

Step 2. Type X: and press “Enter”. ( ‘X’ is infected drive letter )

Step 3. Type attrib -s -h -r -a /s /d *.* . and hit “Enter”.

Step 4. Now type del autorun.inf and hit Enter

CommandExplanation
attribSet attribute
schange file type as system file
hHidden attribute
rRead permission control
aArchive a file or directory
/ssearch throughout including sub folder
/dinclude any process folder

Create Batch file to remove VIRUS

You can make a Batch file to automate the process. You need to create the file in notepad and change drive path accordingly.

Step-1

Open Notepad in your computer and type below DOS commands.

@echo off
X:
attrib -s -h -r -a /s /d *.*
del autorun.inf
exit

Step-2

Save the file as any_name.bat or any_name.cmd. Make sure you type the extension as .BAT or .CMD

That’s all. When you face critical issue in your drive, Just run the file as Administrator by right clicking on the file. or simple select the file and hit Enter.

Note: You can use the batch file on any version of windows operating system.

Leave a Comment

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

//
Our customer support team is here to answer your questions. Ask us anything!
👋 Hi, how can I help?
Scroll to Top

Institute Registration

National Program for Information Technology & Skill Development


Address of your academy:


Submit Documents


Documentation Fee