Windows 7 Forums


Reply
Thread Tools

[SOLVED] Need Administrator to delete?

 
 
Patti Patti is offline
Member
Join Date: Mar 2010
Posts: 58
Thanked: 1
 
      03-15-2011
Hi,
Running W7 Ultimate.
I have an External Hard Disk I used when I transferred my files from old computer to new. I have recently been trying to clear out what is on the Hard Disk.

I have a folder titled Windows 2.01GB I did not think I needed anymore to run my operating system so I tried to delete it. I got the message:
"You need permission to perform this action. You require permission from Administrator to make changes to this folder. Date created 20/10/09"

This is one area I am very vague about since I am the only one using my computer, I have never looked into it. Can anyone tell me how I go about getting Admistrator permission since I am the Admistrator??
Thank you.
 
Reply With Quote
 
 
 
 
Elmer BeFuddled Elmer BeFuddled is offline
Resident eejit
Elmer BeFuddled's Avatar
Join Date: Jun 2010
Location: Durham UK
Posts: 1,050
Thanked: 203
Send a message via Skype™ to Elmer BeFuddled
 
      03-15-2011
You can add a "Take Ownership" to your context menu by saving this code as a .reg file and merging it into your registry. Should only be used to take ownership of files/folders you need to, not recommended to take ownership of your C:\ drive for example.
Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"


[HKEY_CLASSES_ROOT\dllfile\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\dllfile\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"


[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"


[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"


[HKEY_CLASSES_ROOT\exefile\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\exefile\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
Then right click the offending folder, select Take Ownership and a command prompt window will open, do its thing, then close. You should now have ownership of the folder and can do as you want.

A good indicator to see if you need permission to change the name or delete a file or folder is to see if there is the "LUA shield" icon next to the Rename and Delete context menu entries.

Last edited by Elmer BeFuddled; 03-15-2011 at 01:03 PM..
 
Reply With Quote
 
Becky1234 Becky1234 is offline
New Member
Join Date: Mar 2011
Posts: 3
Thanked: 0
 
      03-15-2011
Hi Elmer - I happened to have the same problem right now, trying to delete a directory I had created as an Administrator, but now cannot delete, and sure 'nuff, there is the "LUA shield" icon next to the Rename and Delete context menu entries.

I've cut and pasted your code to a notepad, and will rename it to a .reg, but I'm hesitant to run it yet... what exactly does the code do? Is there anything in there that needs to be edited, or is this code going to just add a "Take Ownership" event to the context menu?

Also, how do I "merge the code into the registry"?

Signed - Whats Up, Doc? :-)
 
Reply With Quote
 
Becky1234 Becky1234 is offline
New Member
Join Date: Mar 2011
Posts: 3
Thanked: 0
 
      03-15-2011
No sooner did I post my post than you went offline <thats what happens when we are on opposite sides of the world!> - so I took a chance and ran the .reg, and was eventually able to delete that horrible directory that wouldn't go away. It was actually created by accident... I had ran an old xcopy .bat file to make a directory and copy files to it that I used to use in XP, but it caused really strange results in Windows 7. That's why I needed to delete it. I just discovered "Robocopy" and will start using that instead.

Still, any additional info you can give me on the Registry changes I've made would be awesome. Cheers!!
 
Reply With Quote
 
Elmer BeFuddled Elmer BeFuddled is offline
Resident eejit
Elmer BeFuddled's Avatar
Join Date: Jun 2010
Location: Durham UK
Posts: 1,050
Thanked: 203
Send a message via Skype™ to Elmer BeFuddled
 
      03-15-2011
Hi Becky1234.
All the reg file does is give you Administrators rights over the various files and folders usually locked by the system ("you don't have permission etc...."). You could do exactly the same by using command prompt and manually entering the instructions. This just automates the commands. Or you could change the permissions/take ownership through the file/folders Properties >> Security tab.

Works on files, folders and drives (but don't use on your system drive! just individual stuff). There's nothing "naughty" in there and it works, well, because it does!!
 
Reply With Quote
 
Becky1234 Becky1234 is offline
New Member
Join Date: Mar 2011
Posts: 3
Thanked: 0
 
      03-15-2011
Elmer - I know this is a little off topic, but WHY does Windows 7 not treat me like an Administrator? I'm of course in the Administrator Group, but sometimes the OS won't let me run an installer or a .bat file without right clicking the file and selecting "Run as administrator." And of course not being able to delete the directory that I created today (by running a .bat file as administrator). Do you know what MS had in mind by implementing Win7 this way? Thanks!
 
Reply With Quote
 
Elmer BeFuddled Elmer BeFuddled is offline
Resident eejit
Elmer BeFuddled's Avatar
Join Date: Jun 2010
Location: Durham UK
Posts: 1,050
Thanked: 203
Send a message via Skype™ to Elmer BeFuddled
 
      03-15-2011
It's all down to Windows 7 enhanced security (I believe). If only the "True Administrator" can change things then neither you nor any bad guys can theoretically mess with your system files.

Last edited by Elmer BeFuddled; 03-15-2011 at 06:41 PM.. Reason: Removed CMD Prompt instruction
 
Reply With Quote
 
TrainableMan TrainableMan is offline
^ The World's First ^
TrainableMan's Avatar
Join Date: May 2010
Location: PA, USA
Posts: 4,654
Thanked: 887
 
      03-16-2011
The Take Ownership script is available for download in the File & Folder section of our Freeware DB.
 
Reply With Quote
 
Elmer BeFuddled Elmer BeFuddled is offline
Resident eejit
Elmer BeFuddled's Avatar
Join Date: Jun 2010
Location: Durham UK
Posts: 1,050
Thanked: 203
Send a message via Skype™ to Elmer BeFuddled
 
      03-16-2011
Quote:
Originally Posted by TrainableMan View Post
The Take Ownership script is available for download in the File & Folder section of our Freeware DB.
Thanks TM, I knew it was here somewhere!
 
Reply With Quote
 
Patti Patti is offline
Member
Join Date: Mar 2010
Posts: 58
Thanked: 1
 
      03-16-2011
Thanks all! I have installed Take Ownership and looked it over and decided I need about a week to figure it all out. Since I don't have that time right now I will put it on hold a few days.
Thanks again, I will get there in the end with all the help.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete windows admin user folder?? babyshoe Windows 7 Support 2 01-30-2012 01:02 AM
Unable to delete unsent mail quincey Software 2 07-17-2010 08:07 PM
can not delete locked file Dj Rj Windows 7 Support 12 06-27-2010 05:10 PM
Cannot delete emails from Libraries\Documents! gadgetlover Windows 7 Support 0 01-17-2010 03:13 AM
Unable to delete a folder Cottonbean Windows 7 Support 4 11-14-2009 09:38 AM


All times are GMT +1. The time now is 06:51 PM.
W7Forums is an independent website and is not affiliated with Microsoft Corporation.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33