How can I delete undeletable folders?

oktomorrow used Ask the Experts™
In XP, in my Programs Files directory, there are some Microsoft folders for programs that I do not want and do not use (msn gaming zone, netmeeting, movie maker, xerox, pin ball, etc.), yet XP won't let me delete them, giving the error message instead:  "Cannot delete _____.  It is being used by another person or program.  Close any programs that might be using the file and try again."  The folder are empty and I am the only user of my computer. I try to keep my system organized and would prefer not to keep passing over these same unneccessary, empty folders every time I access the Program Files folder.  Thanks very much!  
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2007

These may be considered system folders and as such will be difficult to delete.
You may need to turn off the system restore option, and then try.

 I hope this helps !
Top Expert 2007

See the windows help on system restore and

 HOW TO: Restore the Operating System to a Previous State in Windows XP (Q306084)

 I hope this helps !

This doesn't directly answer your question, but maybe you could change the folder attribute to "hidden." It'll still be on your hard drive taking up space (but apparently not much if its empty). But at least it won't be in your way when you access the Program Files folder.

Right click on the folder icon, choose properties, and choose "hidden" under attributes.
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Control panel/add-remove/windows options
make your choices

For some programs you may need to edit the syssoc file to have them show in the add-remove programs.
Ping if you need that info.
To delete those annoying folders that Microsoft kindly gave us, you know, the ones we don't want like Xerox and Microsoft Frontpage et-al just follow these simple instructions:-

1: Do a search for a file called:-
  There are actually two of them, one in C:\WINDOWS\system32 and one in C:\WINDOWS\system32\dllcache\test

2: Rename both these files to:-

3: Restart your computer in Safe Mode with Command Prompt

4: To delete the folder "Microsoft Frontpage", Type this:-
  and hit the Enter (Return) key on the keyboard.
  You will be asked "Are you sure (Y/N)"
  just hit the "Y" key on the keyboard and begin step "4" again but with a different folder address.

If you are unsure of the DOS style name of the folder you want to delete, type this:-
and hit the Enter key. This will give you the real name and the DOS style equivalent names of all files/folders on the root of C:
You will notice that the "Program Files" folder is called "PROGRA~1"
And if you type:-
and hit the Enter key on the keyboard, this will give you the files/folders within C:\Program Files.
You will notice the folder "Microsoft Frontpage" is called "MICROS~1"

The default address of some of the annoying folders are thus:-
C:\PROGRA~1\MICROS~1  (Microsoft Frontpage)
C:\PROGRA~1\NETMEE~1  (Netmeeting)
C:\PROGRA~1\MOVIEM~1  (Movie Maker)
C:\PROGRA~1\OUTLOO~1  (Outlook Express)
C:\PROGRA~1\XEROX    (Xerox)


Renaming SFCFILES.OLD back to SFCFILES.DLL will cause the deleted folders to return.

If you just want to delete a file called "CantDelete.avi" from My Documents, type:-
DEL /F /P C:\DOCUME~1\ (users name) \MYDOCU~1\CANTDE~1.AVI
You will be asked "Are you sure (Y/N)"
Just hit the "Y" key on the keyboard

The switch /S deletes everything within and including the folder.
The switch /F allows the deletion of Read Only files.
The switch /P causes an "Are you sure (Y/N)" question.

"Whack the Windows Messenger (XP Pro only)
We know plenty of people who pay extra for telephone services to prevent telemarketers and other uninvited guests from harassing them on the telephone. Why should you have to deal with this with the Windows Messenger? Remove it! Here's how:
·     Click Start and then click the Run command.
·     In the Run dialog box, type gpedit.msc in the Open text box.
·     Expand the Computer Configuration node and then expand the Administrative Templates node. Finally, expand the Windows Components node and click on Windows Messenger.
·     Double click on either Do not allow Windows Messenger to be run or Do not automatically start Windows Messenger initially, depending on your preference. Select the Enabled option and click OK.
·     Close the Group Policy editor and restart the computer. No more IMer!"

you can remove some other programs as follows:
click Start - Run - and type "cleanmgr" without the quotes and click OK.
Select the drive where windows is located and click OK
Wait while it searches and then click the More Options tab and Windows Components and then select from the lists given (you may need to expand some for the individual programs) - click OK

Be careful in editing the sysoc.inf file as this can cause problems later with the Add/Remove Programs applet.


For information purposes only) Here is the reason why I made the above comment on editing the sysoc.inf file:
Extract from WinXP newsletter I get -
"This method involves editing the sysoc.inf file. Many of you have written to me about this one, but I've tried to make it work on several computers, and it only caused strange things to happen! If you're feeling brave and adventurous, try this one out:
1.     Right click Start and click the Search command.
2.     In the Search window, click the link right above the dog that says More Advanced Options.
3.     Place a checkmark in the following checkboxes: Search system folders, Search hidden files and folders and Search subfolders.
4.     In the All or part of the file name text box, type sysoc.inf. In the Look in drop down list box select Local Hard Drives.
5.     Click Search. After the search is finished, right click the sysoc.inf file that is located in the \WINDOWS\inf folder and click Open With.
6.     In the Open With text box, select Notepad and click OK. Make sure that the Always use the selected program to open this kind of file checkbox is NOT checked!
7.     Remove the hide from the line: msmsgs=msgrocm.dll,OcEntry,msmsgs.inf,hide,7.
8.     Restart the computer. Then click Start and click on Control Panel.
9.     Click on the Add/Remove Programs icon. When the Add/Remove Programs window opens, click the Add/Remove Windows Components button on the right side of the window.
10.     Scroll to the bottom of the list of programs. Remove the checkmark from the Windows Messenger entry and click Next. Messenger will be removed from your system.
I've hesitated about sharing this method, because whenever I've tried it, it added a strange empty icon to my Add/Remove programs windows. One reader wrote to me and said if you go through the above procedure before running Windows Messenger it will work. If you've already run Messenger and configured it, the above method won't work."


apologies for hogging the thread but am just pasting stuff as I find it in a combined newsletter doc I have (I hope it will be useful for other members):

"Windows XP SP1 Allows You to Whack Windows Messenger (and Windows Media Player) for Good!
We spent a lot of effort figuring out ways to whack the Windows Messenger from your computer. If you install Windows XP SP1 you'll be able to remove the Windows Messenger easily! Check it out:
1. Click Start and then click Control Panel.
2. If you're in Category View, click the Switch to Classic View link on the left side of the Control Panel window.
3. Open the Add/Remove Programs applet.
4. Click on the Add/Remove Windows Components button on the left side of the Add or Remove Programs window. Scroll down to the bottom of the list. You'll see the deadly duo right next to each other! Remove the checkmarks from the Windows Media Player (WMP) and Windows Messenger. The Messenger is merely irritating, but the future of the Media Player is to bring "big brother" in to your computer. I don't want that and you don't either. Remove the Media Player and use WinAmp (<>) or some other media player instead.
5. Click Next on the Windows Components page. You'll see the Configuring Components page and a "gas gauge" shows the progress of the uninstall. When the uninstall is done, click Finish on the Completing the Windows Components Wizard page.
Now sit back and breathe a sigh of relief. You've removed the dreaded WMP and its spyware from your computer. Note that while you can also remove Internet Explorer, you don't want to do that! IE is the best browser you can get. You want to whack slimeware and scumware, you don't want to get rid of the good stuff."

hmmm, this is where I need the edit last comment function!
LATER UPDATE" - It appears that the Windows media player cannot be removed. I wont post the whole article but here is a snippet: "Windows Media Player files are protected system files and will regrow automatically, so it doesn't matter if you delete them, they'll just come back!"

i had the same problem...not in the system directory...but i think its everywhere the same :)

its a mysterious "feature" ... :)

- launch the explorer and navigate to the directory where the file or dir is located (e.g. d:\ and the dir is called \blah\)

- in the same directory, create a new file (doesnt matter what kind of file - just a new file/dir (e.g. right click -> new -> new textfile)) (e.g. d:\new textfile.txt)

- now mark the files (the new file/dir and the file/dir) you want to delete... (d:\blah + new d:\textfile.txt)

- now hit del or right click > delete

the file(s) should now be gone :)


I sure appreciate the replies to my post---a wealth of information here!  I adapted the post by "Dirk-Diggler" to solve my problem and did not even have to go to DOS or to the MS-DOS command-prompt. I merely renamed sfcfiles.dll to sfcfiles.dll.old in its two locations, rebooted and was then able to delete the annoying folders at will.  I am wondering if undesirable side-effects could come later from re-naming sfcfiles.dll, but I don't expect any really.  I do not like Windows file protection and am glad to take this further step in disabling it.  Thank you very much!  (Many are adamant till they are blue in the face that there is no DOS in XP, but I beg to differ---I go to DOS in XP all the time with my trusty little floppy that takes me right to every XP drive in DOS, but that's another subject altogether.  But let me add that the floppy merely contains the Windows Millennium and io.sys files and the most basic files of File Wizard [])  


Re my mention of DOS in XP, I hasten to add that my drive is Fat32.  Of course, DOS is not possible in XP if one has NTFS, though even then it is possible with an expensive software (around $300.) like NTFS2DOS.
Since your problem has been solved, perhaps you could close this thread and give the person who solved your problem the points he/she deserves, ie. me me me me me, I want to get to 500 before I retire :D
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial