Possible Duplicate:
How do I get permissions to delete files on Windows 7?

I am unable to delete the following directory in Windows 7

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\iTunes

The error message that is displayed when I try is:

You need permission to perform this action.   
You require permission from the computer's administrator 
to make changes to this folder."

I am an Administrator and have UAC set to "Never Notify". iTunes is not running either (it's been uninstalled).

I have tried running cmd.exe using "Run as administrator" from the right click context menu, then executing

rmdir "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\iTunes"

but it just returns "Access is denied."

Any ideas why I can't delete this dir?

marked as duplicate by Ƭᴇcʜιᴇ007, Nifle, Canadian Luke, Mokubai, Indrek Sep 1 '12 at 22:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You mention two different folders: ...\programs and ...\programs\itunes, which is it? Windows Explorer definitely has ...\programs open and removing that directory would probably destroy your Start Menu. – kreemoweet Sep 1 '12 at 4:52
  • @kreemoweet - sorry, should have been "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\iTunes" – PencilPusher77 Sep 1 '12 at 22:39

The most likely reason is that someone has the directory (or a file in the directory) open as a handle. You can't delete filesystem objects until the handle is released.

Try looking at Sysinternal's handle-view in Process Explorer (Menu > Find > Handle or DLL).

You've probably got ITunes running as a service with a handle to that folder open. You'll need to kill the process in order to delete the file/folder.

  • Yep, turns out I had a different process running with a handle to that dir - launchy.exe. Once killed I could delete the dir. Thanks! – PencilPusher77 Sep 1 '12 at 23:33
  • P.S. I'd vote up if I had more rep. Sorry. – PencilPusher77 Sep 1 '12 at 23:33

Maybe you can try to change the owner of the folder to Administrator. http://www.intowindows.com/how-to-take-ownership-of-a-folderfile-in-windows-7/

Not the answer you're looking for? Browse other questions tagged or ask your own question.