Skip to content

Malware Removal

File Won't Delete or Keeps Coming Back? How to Check for Malware

ScanWith Team 5 min read

Most files that refuse to be deleted are simply open in a program you forgot about.

A few are different: they are held by something you never installed, or they are back a minute after you removed them.

This guide shows how to tell a harmless lock from malware that is protecting itself, and what to do in each case.

Harmless reasons a file stays locked

Rule these out first, because they explain the large majority of cases.

  • Your antivirus is scanning the file. This passes in seconds.
  • Windows Search or a backup tool is reading it.
  • Cloud sync such as OneDrive is uploading it - and will download it again if you delete it on one device only.
  • File Explorer is showing a preview or thumbnail.
  • An installer or updater is still running in the background.

Warning signs that point to malware

  • The file returns after you delete it, even after a restart.
  • The program holding it has a random-looking name, or a familiar name in the wrong place - for example svchost.exe outside C:\Windows\System32.
  • The file sits in AppData, ProgramData or Temp and you never put it there.
  • It appeared together with pop-ups, a changed browser home page or a slow PC.
  • Your antivirus has been switched off and will not turn back on.

One sign alone proves nothing. Two or more are a good reason to check.

Step 1: Do not open the file

Do not double-click it to "see what it is". Looking at its name, size and dates in File Explorer is safe; running it is not.

Step 2: Check its fingerprint

Drop the file into the File Hash Checker. It calculates the SHA-256 checksum in your browser, so the file never leaves your PC.

Paste that checksum into the Threat Scanner. If the file is known malware, VirusTotal and MalwareBazaar already have a record of it.

Step 3: Scan the file itself

No record does not mean clean - the file may simply be new. Upload it to the Online Virus Scanner to have it checked by dozens of antivirus engines at once.

Skip the upload for private documents. For those, a local scan in step 5 is the better choice.

Step 4: Find out what is holding it

Open ScanWith File Unlocker and drop the file on it. The programs holding the file are listed underneath, with their process ID and type.

File Unlocker showing the programs that keep a file from being deleted

Right-click a program you do not recognise in Task Manager and choose Open file location. Then check that program with steps 2 and 3 as well - it is often the real problem.

More ways to identify the owner are in how to find which process is locking a file.

Step 5: Remove it properly

If the scans come back clean, unlock the file and delete it as usual.

If anything is flagged, deleting the one file is not enough, because the part that keeps restoring it is still there.

  1. Disconnect the PC from the internet.
  2. Run a full scan with your antivirus, then a second opinion with the free ESET Online Scanner.
  3. If the malware blocks the scanners or returns after cleaning, start the PC from a bootable rescue disk. Malware cannot defend itself while Windows is not running.

The full walk-through is in how to remove a virus from Windows with a free rescue disk.

Step 6: Check what starts with Windows

Files that come back are restored by something that runs at startup. Open Task Manager and review the Startup apps tab, then look through Task Scheduler for tasks you do not recognise.

Disable entries that point to the suspicious file or folder, restart and confirm that the file stays gone.

After a real infection, change the passwords of your email, banking and shopping accounts from a clean device. Password-stealing malware is common.

Frequently asked questions

Can malware really stop me from deleting a file?

Yes. A running malicious process can keep its own files open, and a second process or a scheduled task can restore them when they are removed.

The file is held by "System". Is that malware?

Usually not. PID 4 is the Windows kernel, which holds drivers and system files. Scan the file if it sits in an unusual folder, but do not try to force the lock.

Is it safe to upload a suspicious file to an online scanner?

It is safe for your PC. Remember that uploaded samples are shared with antivirus vendors, so do not upload files with personal or business data.

WindowsLocked filesMalware removal

Related guides