How do I delete a PDF that is open in another program?

Trying to delete a PDF file that is currently open in another program can be frustrating. The file is in use, so your normal delete options don’t work. But don’t worry, you have a few options for deleting that pesky PDF.

Check if the PDF is open in another program

First, you’ll want to check if the PDF is definitely open in another program. Try opening the folder where the PDF is saved and see if you get a message that the file is in use or open elsewhere. You can also use the Task Manager in Windows to view open applications and check if a PDF reader or editor is running with that file open.

Close the program using the PDF

The most straightforward solution is to simply close the program that has the PDF open. For example, if the file is open in Adobe Acrobat Reader, close the Reader application. Or if it’s open in a web browser, close that browser. This will free up the file and allow you to delete it.

Step-by-step instructions

  1. Open the Task Manager by pressing Ctrl+Shift+Esc on your keyboard.
  2. Click the “Processes” tab.
  3. Scroll through the list of running processes and look for any PDF reader applications, such as Acrobat Reader (AcroRd32.exe).
  4. Select the process and click “End task” to force it to close.
  5. You can now try deleting the PDF file again.

Use Unlocker to delete the file

If closing the associated program doesn’t work or you can’t determine what has the file open, a handy utility called Unlocker can force the deletion of locked files.

Step-by-step instructions

  1. Download and install Unlocker from https://www.majorgeeks.com/files/details/unlocker.html
  2. Right-click on the locked PDF file and select Unlocker from the context menu.
  3. Unlocker will display the programs/processes locking the file.
  4. Click “Delete” to forcibly delete the locked file.

Unlocker is a safe and easy way to remove files that can’t be deleted normally. Just be careful when forcibly deleting files in use.

Delete the file on next reboot

If you don’t absolutely need to delete the file right now, you can have it automatically deleted the next time you restart your computer.

Step-by-step instructions

  1. Use the keyboard shortcut Win+R to open the Run dialog box.
  2. Type “temp” and hit Enter to open your temp folder.
  3. Right-click and create a new text document (New > Text Document).
  4. Name the file anything you want with a .bat extension (e.g. deletefile.bat).
  5. Edit the .bat file in Notepad and enter the command: DEL "C:\Path\to\locked.pdf" (make sure to add the actual path/filename)
  6. Save and close the .bat file.
  7. Move the .bat file to your Windows Startup folder (type “shell:startup” in Run dialog)
  8. Restart your computer. The .bat will run on startup and delete the PDF.

This technique schedules the file deletion for the next reboot, allowing whatever program has it locked to release it.

Unlock the file with Unlocker, then delete

Unlocker (mentioned above) can also be used to first unlock a file before deleting it.

Step-by-step instructions

  1. Download and install Unlocker.
  2. Right-click the locked file and choose Unlocker.
  3. In Unlocker, click Unlock All, Apply Changes, and OK to unlock the file.
  4. Now you can delete the file normally in File Explorer.

This unlocks the file so you can immediately delete it instead of waiting for a restart.

Delete via Command Prompt

Using the Command Prompt, you can delete read-only or locked files with the /F switch on the DEL command.

Step-by-step instructions

  1. Open the Command Prompt as admin.
  2. Navigate to the folder with the locked PDF, e.g. CD C:\Users\Name\Documents
  3. Enter DEL /F "locked.pdf" using the file’s name.
  4. Press Enter to force delete the file.

The /F parameter forces deletion and overrides the file lock.

Delete using Powershell

Similar to Command Prompt, you can also delete stubborn locked files using Powershell.

Step-by-step instructions

  1. Open Powershell as an admin.
  2. Navigate to the folder location, e.g. CD C:\Users\Name\Documents
  3. Enter Remove-Item 'locked.pdf' -Force using the file name.
  4. Press Enter to force delete the file.

The -Force parameter overrides the lock and deletes the file.

Disable or stop associated services/software

In some cases, a Windows service or background program is locking the PDF file. You may need to temporarily disable or stop the responsible service entirely in order to delete the file.

Step-by-step instructions

  1. Open the Run dialog with Win+R and type “services.msc”.
  2. Browse the list of services and look for any associated with PDFs or your PDF software.
  3. Right-click the service and choose Stop to temporarily stop it.
  4. Now try deleting the PDF file.
  5. Once deleted, right-click the service again and choose Start to re-enable it.

Stopping problematic services might allow the file lock to be released long enough for deletion.

Use a bootable USB drive

Using a bootable USB drive with a Linux-based OS is an advanced option, but allows you to access locked files from outside the normal operating system.

Step-by-step instructions

  1. Download a Linux distro ISO file like Ubuntu Desktop.
  2. Use Rufus to create a bootable USB drive with the ISO.
  3. Restart your PC and boot from the USB drive.
  4. Navigate to the PDF file on your main OS drive.
  5. The file should not be locked anymore and can be deleted.
  6. Restart without the USB to boot back into Windows.

This gives you full access to the locked file from outside of Windows to force deletion.

Conclusion

Deleting a PDF in use by another program can require some creative solutions. The easiest options are to close the associated application or use a utility like Unlocker. For stubborn locks, Command Prompt, Powershell, services, or even an external OS on a USB drive can get the job done. Just make sure you really need to delete the file before forcing removal.