How to Locate Viruses Using the Attrib Command
Part 1 of 2:
Opening Command Prompt
- Open the Start menu. Click the Windows logo in the bottom-left corner of the screen, or press the ⊞ Win key on your keyboard.
- For Windows 8, place your mouse cursor in the top-right corner of the screen, then click the magnifying glass icon when it appears.
- Type command prompt into the "Search" field. Doing so will search your computer for the Command Prompt app, which will pop up at the top of the search menu.
- If you're using Windows XP, you'll instead click the Run app on the right side of the Start menu.
- Right-click Command Prompt. It resembles a black box. Doing this will invoke a drop-down menu.
- If you're using Windows XP, you'll instead type cmd.exe into the Run window.
- Click Run as administrator. It's near the top of the drop-down menu. Doing so will open Command Prompt with administrator privileges.
- You'll need to confirm this choice by clicking Yes when prompted.
- If you're using Windows XP, you'll click OK to open Command Prompt.
- You won't be able to run Command Prompt in administrator mode if you're on a restricted, public, or networked computer (e.g., a library or school computer).
Part 2 of 2:
Locating and Deleting Viruses
- Type in your directory's name. This will typically be the letter on the disk drive (e.g., "C:").
- Press ↵ Enter. This will change the Command Prompt's search location to your selected directory.
- Type
attrib -r -a -s -h *.
* into Command Prompt. The "attrib" command forces all hidden, read-only, archived, and system files to display in Command Prompt, and the "-r -a -s -h *.*" section of the command removes these attributes from non-legitimate files.- Any legitimate system files won't have their attributes removed, and you'll see "Access Denied" listed to the left of them.
- Press ↵ Enter. Doing so will display all previously hidden system files' names.
- Scroll up to find your virus. If you know the virus' name, you'll simply need to scroll up to it. Otherwise, look for files ending in ".inf" and ".exe" that don't look familiar.
- Before proceeding, be sure to double-check any file names you suspect of being viruses by looking them up.
- Common virus names include "autorun.inf" and "New Folder.exe".[1]
- Type del [file name] and press ↵ Enter. Doing so will remove the virus from your computer.[2]
- For example: to delete the "autorun.inf" virus, you'd type in del autorun.inf.
- Close Command Prompt. The virus should no longer affect your system. You may even notice a slight increase in computer running speed or app response time.
4.3 ★ | 4 Vote
You should read it
- How to Customize the Font in Windows Command Prompt
- How to Create a Custom Windows Command Prompt
- How to open Microsoft Excel from Command Prompt
- Add Command Prompt to Power User Menu on Windows 10
- How to open Command Prompt on Windows 10, 8, 7, Vista and XP
- How to Make Command Prompt Appear at School
- 6 Best Command Prompt Alternatives for Windows
- How to use Xcopy command in Command Prompt
May be interested
- How to Change the Computer Time and Date Using the Command Promptthis wikihow teaches you how to change your time and date on a computer running the windows operating system using the command prompt app. if you don't have administrator access on your computer, you won't be able to change the time and...
- How to Delete a File Using Command Promptthis wikihow teaches you how to delete a file from your pc's desktop by using a command in command prompt. locate your file. if you know where the file is, you can navigate to it by simply opening the appropriate folder. for example, if...
- How to Find All Commands of CMD in Your Computerhave you forgotten a certain command that you need to use in the command prompt? you can quickly list most commands, allowing you to search the list and find the one you need. you can also use the same function to get additional help for...
- How to Open the Command Prompt in Windowsthis wikihow teaches you how to open the command prompt program in windows. there are several ways to do this, from simply searching in the start menu to using a run command. keep in mind that some computers, such as school computers, will...
- How to Watch Star Wars on Command Promptthis wikihow teaches you how to watch a version of 'star wars' rendered entirely in ascii characters (by folks with a lot of free time) using command prompt on windows or terminal on mac. open command prompt. you can open command prompt by...
- How to Run a Batch File from the Command Line on Windowsthis wikihow teaches you how to run a batch file (.bat) from the windows command line. you can run the program from the 'run' dialog or by typing commands into a terminal window. press . this opens the run dialog.