Results 1 to 3 of 3

Thread: Download script to take ownership and grant Administrators full control access from command prompt

  1. #1
    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.

    Description
    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 Attached Files
    "The answer is out there, and it's looking for you, and it will find you if you want it to."

  2. #2
    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

  3. #3
    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

Similar Threads

  1. Access a shared folder with command prompt?
    By Venator in forum Operating Systems
    Replies: 4
    Last Post: 12-03-2009, 07:47 PM
  2. Access Control panel Applet via command line
    By Kraker999 in forum Operating Systems
    Replies: 2
    Last Post: 28-02-2009, 06:49 PM
  3. Access Denied in Win Vista's command prompt
    By Salome in forum Operating Systems
    Replies: 2
    Last Post: 23-02-2009, 07:02 PM
  4. How to Run Command Prompt in Full Screen ?
    By Japheth in forum Customize Desktop
    Replies: 3
    Last Post: 20-02-2009, 12:21 PM
  5. Block Access to Command Prompt in windows xp
    By pushpendra in forum Operating Systems
    Replies: 3
    Last Post: 12-01-2009, 10:30 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,673,704.53996 seconds with 18 queries