Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a portable hard disk which at one time was installed in a PC and windows XP installed on it. Now I am using it as a backup and I want to delete the Windows directory from it, but when I try to delete the Windows directory I am getting an error that I cannot delete it. The hard disk is connected to my PC via USB. My PC boots from its own hard disk and has Windows Vista Business.

How can I delete these files from the portable hard disk?

share|improve this question

migrated from Nov 1 '11 at 19:40

This question came from our site for professional and enthusiast programmers.

The problem is probably the file permissions. See… and in particular the link to… – Harry Johnston Nov 1 '11 at 20:16

Right-click on the partition and select the Security-tab. Click Advanced.

First: Take ownership of the folder/partition (close all dialogs to apply the change, and Open it again). Second: Set Full-access for your account/All Users-account.

That should also work for Vista

share|improve this answer

The easiest way to clean off the hard drive is to reformat. Make sure you pull off the files you want to keep, and then just do a deep clean. You can put the files you pulled off back on later.

Chances are, Windows Search is just scanning the folder.

There are a lot of complicated ways to do it, from Safe Booting to disabling Windows Services to running Linux.

The truth is, the simplest way is just to reformat.

share|improve this answer
Agree with the format. I doubt that Search indexer is the problem, though it could delay the delete. – Michael9000 Nov 1 '11 at 20:39

FileAssassin does the job quite nicely. It unlocks file handles and (optionally) deleted the file. It can also trigger the "delete on restart" job which is a function of Windows itself.

  1. Download the software and open it. You will see this: FileAssassin main window

  2. Select a file by either dragging the file itself (from the explorer!) into the text area of FileAssassin or using the attached select button.

  3. Now you can select what FileAssassin should do.

    • The "FileAssassin method": This first option allows you to do several things at once, namely:
      • Unlock locked file handles (this will try to remove all the Windows handles that block the file from being deleted)
      • Unload modules (I am not a 100 % on this, but if it's a library (DLL), it will try to unload it wherever it is loaded)
      • Terminate the file's process (This will terminate any process which bears this file's name. Helpful if it's an exe, although you could have done this yourself using the task manager!)
      • Delete file (straightforward)
    • Delete on reboot: Uses the Windows built in delete on reboot functionality
    • Use normal delete function: Pretty pointless most of the time since that's exactly what you are already doing.

If you are sure you are not deleting a file which is critical for the system, select the first option and all the checkboxes below that. The second and third checkboxes only trigger for modules and executables, so it doesn't matter if they are selected or not.

share|improve this answer
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Ivo Flipse Jul 14 '12 at 12:38
@IvoFlipse Got it, expanded it to explain what FileAssassin does (the text is original, no copypasta). – sinni800 Jul 15 '12 at 11:54

What i did was go t windows explorer whihc is the library thingy on the left you will see files, click on one, then right click and you will see it is read only, so unclick it. Worked for me but i only had one program that was read only.

share|improve this answer

To delete a MS Windows file, you have to right click it, click Properties, go to Security, Advanced, Change Permissions, and make sure you are an admin. Click your username and click Edit. Then click "Full Control" and exit all the windows you opened. This should work for versions from windows 2000 to windows 7.

share|improve this answer

To complete what @Michael9000 said: There is also a registry hack which adds a "take ownership" entry to the right click menu. Download the hack, run it, then right click on the folder to take ownership and then delete it. Info about the hack can be found here:

Add or Remove the Take Ownership Option to the Right Click Context Menu

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .