PDA

View Full Version : Script to Take Ownership and Grant Full Control


admin
05-24-2007, 07:01 PM
Use this script to easily take ownership and grant Administrators full control access from command prompt.

Warn that the script works recursively.

More information here (http://www.mydigitallife.info/2007/05/25/easier-way-to-take-ownership-and-grant-access-files-or-directories-in-vista/).

Elfin
07-25-2007, 02:17 AM
I had a weird goof lately, While selecting a directory to install a program, to I accidently drug and dropped a large folder into another directory. This was in Win XP.

I had to use Vista to even get it so that I could see the directory and contents. Somehow the drag and drop caused the folder permissions to be lost for the whole large backup directory.

Well I finally did figure out the permissions setting routine by trial and error, but realised I would have to do it for each and every file This directory has 412 files in it.

So a little googling later and I found this thread. What a Lifesaver this little command is. It worked a treat and reset all of the permissions back to normal.
I am one happy Nerd, Thank you.

P.s. Sorry I am a bit rambly but I am very happy at the moment.

addbudy
07-29-2007, 03:54 AM
hello, I have a serious problem:(:(, I need its aid, that tendria that to write exactly in Cmd.exe? if I want to have control of “C:\windows”? thanks, hopefully can help me :D:D

reilus
08-25-2007, 01:46 AM
how do I get the permissions back to normal????

Thanx...

sabrehawk
10-25-2007, 12:53 AM
iCACLS Vista Command Prompt Tool to Manage ACLs » My Digital Life

http://www.mydigitallife.info/2007/04/30/icacls-vista-command-prompt-tool-to-manage-acls/

http://www.bpsoftware.com/products/BPACLer/

William26
02-11-2008, 02:50 PM
the file downloads to desktop but when I run it, it doesn't seem to unzip and give me the .reg file. Is there a step I am missing? Or is the link not properly connected to the file?

thanks

TheShadowFL
03-23-2008, 03:29 PM
the file downloads to desktop but when I run it, it doesn't seem to unzip and give me the .reg file. Is there a step I am missing? Or is the link not properly connected to the file?
thanks

to take all the pain and sorrow out of UN-Zipping downloaded files,
get and install "7Zip". (it's FREE)

Then all you have to do to unzip a file is right click it.
Then on the drop down menu, select 7Zip....on it's own drop down menu,
select 'Extract Here' to unzip the file in it's present location. Job done!

Like so many, I suffered with zip'd files for years, until finally getting 7Zip.
It's by far the best archiving program I've ever used.

Cheers Mates!
The Shadow :cool:

glasscreations
03-25-2008, 01:21 AM
Can you simplify the instructions I am an advanced computer user but as far as old school scripts go I'm lost. I came into computers at the end of the dos era so I know the basics of dos but not a whole lot of tricky commands.

Do I need to edit the script for it to work?
Do I need to place it in a specific place?
Can I make it change all files in a folder and sub folders at once?

Can you give me step by step instructions with explanations.

Heidegger
03-25-2008, 05:59 PM
Here's a reg file that adds a Take Ownership command to your context menu for all items and directories.

persuasive
03-28-2008, 05:37 PM
Thanx a lot for the reg file!!!:)

hanzzon2
03-28-2008, 11:00 PM
Take note that the group "administrators" is so called only on the English language version of Windows

If you have a localized version (does not apply to English with a MUI language pack)
You will need to replace the word a"administrator" in the script with whatever it's called in your localized version of Windows

For Swedish this would be Administratörer for example

ShadowKaito
04-12-2008, 02:53 AM
I'm still a bit lost.

And whenever I try to open TC it shutsdown automatically.

I don't know what else to do.

I have Vista Home Premium, just for those who are wondering.

:(:(:(:(

N3RO
05-14-2008, 10:51 AM
Hi guys,

Do you know some way to take ownership of Windows XP?

System32 folder ;)

Thanks,

grumps
05-14-2008, 11:59 PM
Here's a reg file that adds a Take Ownership command to your context menu for all items and directories.

Great thanks.:)

tabristow@nc.rr.com
05-16-2008, 02:24 AM
I'm new to this group and am probably not as advanced as most of the users. Long Story short - tried to install Corel Painter X - I get this screwy message "The application failed to initialize properly (0xc0000022). Click OK to terminate the application."

After a lot of research I figured out it was a permissions problem. I have Vista Business 32-bit..........I'm the administrator but for some reason can not change permissions to full control. Everything is grayed out. I downloaded and unzipped the "takecontrol" file you offered, but I evidentally didn't do something correct because nothing has changed. Can someone tell me what to do. I was so excited to finally have this program and I already have 8 hours into trying to make it work. I tested it on my new laptop and everything is perfect - but I really need it on this machine and not the laptop.

petar
05-16-2008, 09:07 AM
I'm new to this group and am probably not as advanced as most of the users. Long Story short - tried to install Corel Painter X - I get this screwy message "The application failed to initialize properly (0xc0000022). Click OK to terminate the application."

After a lot of research I figured out it was a permissions problem. I have Vista Business 32-bit..........I'm the administrator but for some reason can not change permissions to full control. Everything is grayed out. I downloaded and unzipped the "takecontrol" file you offered, but I evidentally didn't do something correct because nothing has changed. Can someone tell me what to do. I was so excited to finally have this program and I already have 8 hours into trying to make it work. I tested it on my new laptop and everything is perfect - but I really need it on this machine and not the laptop.

Double click on the reg file and click ok when prompted.
Open Explorer(My Computer), right click on C: and select Take Ownership.
There will be a litle waitinng couse the script has to process all the files on the drive.

jangell2
05-17-2008, 03:23 PM
Here's a reg file that adds a Take Ownership command to your context menu for all items and directories.I'm not clear how to run a reg file. If I double-click on it thru winexp, it opens notepad. I tried right-click, merge and that opened notepad. How do I run it? I'm using Vista Home Premium.

petar
05-17-2008, 03:41 PM
I'm not clear how to run a reg file. If I double-click on it thru winexp, it opens notepad. I tried right-click, merge and that opened notepad. How do I run it? I'm using Vista Home Premium.

You seem to have a file asociation problem..
Do the folowing:
1. Right click on the file and choose "Open With"
2. Browse for the regedit.exe
3. It can be found in c:\windows\regedit.exe
4. Click OK.
5. Double click on the file.

jangell2
05-17-2008, 05:26 PM
You seem to have a file asociation problem..
Do the folowing:
1. Right click on the file and choose "Open With"
2. Browse for the regedit.exe
3. It can be found in c:\windows\regedit.exe
4. Click OK.
5. Double click on the file.Thank you. I had already opened up regedit and done an import which worked fine. I sure find it odd that a .reg file isn't already associated with regedit.

Activex
06-20-2008, 02:45 PM
Thank you, it's works fine.

opining the reg file.
then right click on the file and choose take onwership, and that is it !


Thank you.

lanith
10-15-2008, 05:24 AM
Well, I DL'd it to desktop. Then I put the file on the desktop and double-clicked. Saw the command prompt appear for a split second then disappear. Did I do anything? (Has anything been added to the registry)?

Thanks so much.

-Lanith.

bruno13
10-24-2008, 06:39 AM
i am running RCrawler 4.5.04 in windows vista bussiness edition.
It gives an error "failed to find the regedit tool" while clicking the
hyperlink.
pls tell how to resolve this.

wisitor
11-14-2008, 02:52 PM
thanks, this script saved me from alot of problems.

¦•••SHERIFA•••¦
12-06-2008, 10:11 PM
Hello, I've take the ownership on System32 folder ( and all folders, subfolders & files ). How to return this ?

admin
12-08-2008, 05:52 PM
Hello, I've take the ownership on System32 folder ( and all folders, subfolders & files ). How to return this ?

Try to use sfc?

¦•••SHERIFA•••¦
12-08-2008, 08:48 PM
Yes (http://vistasupport.mvps.org/system_file_checker.htm):

C:\Windows\System32>sfc /scannow

Beginning system scan. This process will take some time.

Beginning verification phase of system scan.

Windows Resource Protection found corrupt files but was unable to fix some of them.
Details are included in the CBS.Log windir\Logs\CBS\CBS.log. For example
C:\Windows\Logs\CBS\CBS.log

From the file:

2008-12-08 21:43:43, Info CSI 0000000c [SR] Verifying 100 (0x00000064) components
2008-12-08 21:43:43, Info CSI 0000000d [SR] Beginning Verify and Repair transaction
2008-12-08 21:43:43, Error CSI 0000000e (F) STATUS_OBJECT_NAME_NOT_FOUND #545466# from Windows::Rtl::SystemImplementation::DirectFileSyst emProvider::SysCreateFile(flags = (AllowSharingViolation), handle = {provider=NULL, handle=0}, da = (STANDARD_RIGHTS_READ|FILE_READ_ATTRIBUTES), oa = @0x19ce7c4->OBJECT_ATTRIBUTES {s:24; rd:NULL; on:[119]"\??\C:\Windows\WinSxS\msil_microsoft.managementcon sole.resources_31bf3856ad364e35_6.0.6000.16386_en-us_0063e7b750b58e3b"; a:(OBJ_CASE_INSENSITIVE)}, iosb = @0x19ce7e4, as = (null), fa = 0, sa = (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELET E), cd = FILE_OPEN, co = 0x00004000, eab = NULL, eal = 0, disp = Invalid)
[gle=0xd0000034]
2008-12-08 21:43:43, Error CSI 0000000f@2008/12/8:19:43:43.173 (F) d:\rtm\base\wcp\sil\merged\ntu\ntsystem.cpp(1817): Error STATUS_OBJECT_NAME_NOT_FOUND originated in function Windows::Rtl::SystemImplementation::DirectFileSyst emProvider::SysCreateFile expression: (null)
[gle=0x80004005]
2008-12-08 21:43:43, Error CSI 00000010 (F) STATUS_OBJECT_NAME_NOT_FOUND #545465# from Windows::Rtl::SystemImplementation::CDirectory::Op enExistingDirectory(...)[gle=0xd0000034]
2008-12-08 21:43:43, Error CSI 00000011 (F) STATUS_OBJECT_NAME_NOT_FOUND #545464# from Windows::Rtl::SystemImplementation::CDirectory_IRt lDirectoryTearoff::OpenExistingDirectory(flags = 0, da = (SYNCHRONIZE), oa = @0x19ceba8->SIL_OBJECT_ATTRIBUTES {s:20; on:"msil_microsoft.managementconsole.resources_31bf385 6ad364e35_6.0.6000.16386_en-us_0063e7b750b58e3b"; a:(OBJ_CASE_INSENSITIVE)}, sa = (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELET E), oo = (FILE_DIRECTORY_FILE|FILE_SYNCHRONOUS_IO_NONALERT| FILE_OPEN_FOR_BACKUP_INTENT), dir = NULL, disp = Invalid)
[gle=0xd0000034]

chr15_mo55
01-15-2009, 03:02 AM
Playing around with windows 7 and the homegroups when all my music needed permissions! have so much did not want to do them 1 by 1 thanks alot:) will keep the reg safe

mehappy
01-20-2009, 09:19 PM
Hi,
I was looking for this script for a week now! I've read about "Takecontrolof.cmd" and decided to use this script to change owner of C:\Windows\System32\Mapisvc.inf on a Vista client. Takecontrolof.cmd is stored in the same folder as Mapisvc.inf. Unfortunately it doesn't work for me! :(

This is what I get when I run this script:

"C:\Windows\System32>takeown /f c:\windows\system32\mapisvc.inf /r /d y
ERROR: The specified path is not a valid directory path.

C:\Windows\System32>icacls c:\windows\system32\mapisvc.inf /grant administrators
:F /t
processed file: c:\windows\system32\mapisvc.inf
The system cannot find the file specified.
Successfully processed 1 files; Failed processing 1 files"

I'll be grateful if someone can explain to me what I'm doing wrong here, please?

Thanks

Regards
MeHappy

Singapore_Air
01-25-2009, 08:15 PM
Thanks a lot for this tool !

I just wasted half an hour trying to take ownership of the WinSxS folder but the script did it in about 2 minutes !

Ontittech
02-21-2009, 04:23 AM
I have a file that TakeControlOf does not work on still.

It is a VOB that was created when I dumped my Video Camera to my PC. now I am trying to delete it, and it says i need permission.

I have tried deleting it using the Local Admin account (The So Called "Hidden Admin" without Luck, and TakeControlOf Wont Delete it either. I am pulling my hair out as it is a 6.2GB file which is taking up a good share of my Download Partition. I am almost ready to move everything else off that partition and blow it away.

Any other suggestions?

akakrill
03-08-2009, 02:48 PM
Here's a reg file that adds a Take Ownership command to your context menu for all items and directories.


THAT REG KEY SAVED MY LIFE! Thank you, We should mass distribute that! FU Windows!

xpert
03-30-2009, 06:52 PM
The Take Ownership reg file works like a charm!!!

Thanks a lot!!!!

Zephans
04-03-2009, 12:51 AM
This post saved me!

Wow... I spent 2 hours poking around trying to figure out how to take ownership of 5109 files I accidentally copied from my Vista System folder to my external backup drive. I was NOT going to hand-update each one... and even then I couldn't get Properties->Security options to work since only TrustedInstaller has full rights. (Even Administrator account does not have delete or other rights beyond read/write!)

FYI: If the TakeControlOf.cmd script disappears it is pretty easy to just use the related commands in desired directory "takeown /f . /r /d y" and "icacls . /grant administrators:F /t".

Here's more detailed steps (for Vista) that don't require downloading anything:
1. Click Start, then type cmd.exe
2. Wait a second for cmd.exe to appear in top of Start menu, then right click cmd.exe menu and select "Run as administrator".
3. In cmd.exe change to directory you wish to take ownership of
CD c:\directoryname\etc.
4. Enter following commands in order (replacing %1 with desired path/filename or "." for current directory):
takeown /f %1 /r /d y
icacls %1 /grant administrators:F /t

ankdoz
04-10-2009, 12:18 PM
that was an awesome way of deleting stuff..thanks for the stuff...
Oz

EamonKunze
04-15-2009, 12:22 AM
1st and 2nd reg keys doesn't always work.
the cmd solution is much better.

imemine
04-28-2009, 05:42 PM
when I right click this on a folder I get an error that the operating system has shut down and gives me the look on internet or close prog. I'm wasting half my day here because I can't access any of the document files I created on my laptop. I'm the only administrator/user. The program didn't work for me.

RobMongoose
05-01-2009, 12:23 PM
Excellent. Thanks for providing the script that I was too lazy to write myself....

One of my hard drives had decided that I had no access rights after a Vista reinstall. This sorted it straight away.

Thanks again!

Angelz_curse
08-29-2009, 12:54 PM
I got into this situation when I had to back up my files from one computer and transfered them to another computer, so obviously the premissions were for the previous computers domain and users.

Without this tool, I would have to laboriously go through every file and folder and set the object to belong to me, then I would then need to enter the file/folder and manualy add myself on the ACL then from there give myself the permissions.

this tool simplifies this if your computer wont allow you to use the ICACLS command.

TO USE:


Download the link from this forum, put the file in a location you can access it from a command line, i.e F:backUP/TakeControlOF.cmd (my external hard drive, inside my backup folder)

Then open the cmd promt in administrator, (start, programs, applications, right click on cmd promt)

Navigate to the folder with the TackControlOF.cmd batch file.

Run the cmd file by typing 'TakeControlOf <REPLACE WITH FILE/FOLDER TO RESET PERMISSIONS>'


All the best, one little problem fixed :D
from Angelz_curse

smarty__sam
08-30-2009, 02:56 PM
i m using windows vista from my laptop HP DV5 .yesterday i was deleted Security Tab from my D:\ drive.& i delete all the groups & users .now i got the the error access denied .i cannot access my drive .any how .please give me some suitable solution i ll thankful to you guys. and here is the screen shot of same thing.

http://www.turboimagehost.com/p/2066509/HD_HELP.jpg.html

urie
08-30-2009, 08:28 PM
I got into this situation when I had to back up my files from one computer and transfered them to another computer, so obviously the premissions were for the previous computers domain and users.

Without this tool, I would have to laboriously go through every file and folder and set the object to belong to me, then I would then need to enter the file/folder and manualy add myself on the ACL then from there give myself the permissions.

this tool simplifies this if your computer wont allow you to use the ICACLS command.

TO USE:


Download the link from this forum, put the file in a location you can access it from a command line, i.e F:backUP/TakeControlOF.cmd (my external hard drive, inside my backup folder)

Then open the cmd promt in administrator, (start, programs, applications, right click on cmd promt)

Navigate to the folder with the TackControlOF.cmd batch file.

Run the cmd file by typing 'TakeControlOf <REPLACE WITH FILE/FOLDER TO RESET PERMISSIONS>'


All the best, one little problem fixed :D
from Angelz_curse

Have you never tried just booting with a PE cd and copying files never had a problem with permissions

BlackberryBlake
10-07-2009, 07:59 AM
when i open takecontrolof the command prompt opens, runs a bunch of lines and then disappears. I assume this means it isn't working?

ShaunL
10-15-2009, 06:04 AM
Sorry to post in such an old thread, however I am having some problems.

First, I have installed the .reg that I downloaded from page 1 of this thread. When I right click on files, it does appear in the menu, and it does appear to work. HOWEVER, it does not show up on the file that I need to take ownership on. The file is an .exe -- does that make a difference? I tested to see if it would appear on other .exe files and it does not.

I tried doing it manually in cmd (running cmd as an administrator):

takeown /f "filepath" /r /d y
icacls "filepath" /grant administrators:F /t

I used quotations because there are spaces in my directory.

Once again, this works for all the files EXCEPT the one I need to take ownership of (says success for all other files)

INFO: Access is denied. ( "filepath\file.exe" )
and
filepath\file.exe: Access is denied.
Successfully processed 2 files; Failed processing 1 files

Please help!

baracuda81
11-19-2009, 11:12 AM
Awesome. i erased all windows 7 system files. It works perfectly :)
thanks

urie
11-19-2009, 10:36 PM
Awesome. i erased all windows 7 system files. It works perfectly :)
thanksKewl So i take it you are posting this from a Linux machine. If you had erased all windows 7 system files, then you computer wouldn't boot into windows.:D