3

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?

2
  • 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, 2012 at 4:52
  • @kreemoweet - sorry, should have been "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\iTunes" Sep 1, 2012 at 22:39

2 Answers 2

6

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.

3
  • 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! Sep 1, 2012 at 23:33
  • P.S. I'd vote up if I had more rep. Sorry. Sep 1, 2012 at 23:33
  • Process Explorer does not exist in Windows 11. Aug 10, 2022 at 15:13
4

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 .