Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Thread Tools Search this Thread
Old 24-01-2009
Join Date: Dec 2005
Posts: 134
Download script to take ownership and grant Administrators full control access from command prompt

Use this script to easily take ownership and grant Administrators full control access from command prompt.

In Windows Vista, there are lots of files and directories especially those operating system files plus Windows and Windows\System32 folders have been protected. These protected system files aren’t belong to any users or groups, instead are owned by TrustedInstaller, with even Administrator or Administrators group doesn’t have modify or write access to them. Thus if you intend to manipulate or replace the files, you’ll encounter access denied error even though you are administrator and have disabled UAC or already in elevation mode for the application trying to access.

In this case, users will probably have to right click on the object, then access the object’s properties. Then users have to click on Security tab, click on Advanced button, click on Owner tab, and then perform several clicks and confirmations to take ownership of the object. The whole process have to repeat again to grant read-write-modify or full control access rights to the users. The whole process takes lengthy time, troublesome, involves lots of clicks and steps. To simplify the process, simply download the TakeControlOf.cmd command line batch script, which will automatically take ownership and grant full control access rights by assigning new ACLs (Access Control Lists) to the file or directory that input to the command.

Download TakeControlOf.zip from the attachment.

TakeControlOf.cmd makes use of two command-line utilities takeown (takes ownership of a file or directory) and icacls (sets new ACLs on a files or directory) respectively. Full Control access privilege will be given to Administrators group.

To use the batch script, simply launch an elevated command prompt, then run the script. Below is same examples (command should be issued from the directory where you store the TakeControlOf.cmd script):

TakeControlOf C:\Windows\Test_File.exe
TakeControlOf C:\Test_Directory

Note that if you specify a directory, the script will works recursively to include all subdirectories. To change this behavior, edit the TakeControlOf.cmd and remove /r from the takeown (first) line, and /t from icacls (second) line.

Source: mydigitallife.info
Attached Files
File Type: zip TakeControlOf.zip (190 Bytes, 170 views)
"The answer is out there, and it's looking for you, and it will find you if you want it to."
Reply With Quote
Old 24-01-2009
Join Date: Nov 2005
Posts: 103
Re: Download script to take ownership and grant Administrators full control access from command prompt

Nice, thanks for the batch file, works flawlessly
Reply With Quote
Old 14-02-2009
Join Date: Feb 2009
Posts: 1
Re: Download script to take ownership and grant Administrators full control access from command prompt

man i have had a horrible experience trying to fix this dinput8.dll error while launching games and i was pretty sure all i needed to do was re-download the dll from a clean source, that wasnt a problem, but getting control of system 32 took a few days of goggling. With this I was able to replace it as easy as windows should have let me in the first place. This is the only time Vista has made me furious.

Thank you for creating this, as I just couldn't get the right click security options to do anything useful even when full control was given. But this worked like a charm.

For future googlers reading this make sure you put the file in your user folder for it to work...or at least that's where mine needed to be c:\user\yourname

(whatever location is at the begging of your cmd line is where the file needs to be)

for instance i needed control of my .dlls so my command line looked like this

c:\user\tiffany> TakeControlOf C:\Windows\system32

thanks again for this file
Reply With Quote

  TechArena Community > Software > Software Development
Tags: , , , ,

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads for: "Download script to take ownership and grant Administrators full control access from command prompt"
Thread Thread Starter Forum Replies Last Post
Access a shared folder with command prompt? Venator Operating Systems 4 12-03-2009 07:47 PM
Access Control panel Applet via command line Kraker999 Operating Systems 2 28-02-2009 06:49 PM
Access Denied in Win Vista's command prompt Salome Operating Systems 2 23-02-2009 07:02 PM
How to Run Command Prompt in Full Screen ? Japheth Customize Desktop 3 20-02-2009 12:21 PM
Block Access to Command Prompt in windows xp pushpendra Operating Systems 3 12-01-2009 10:30 AM

All times are GMT +5.5. The time now is 09:07 PM.