Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Take Ownership tweak removes Run as Admin

03 Jun 2010   #21
spddemun

Windows 7 Pro x64 (Upgrade, Clean Install)
 
 

I installed this Tweak today, very interesting! My reason is I have pulled my HDD (laptop power connector cracked off of mobo!), and am trying to remove all personal info.

Have given up on that, as I'm in a hurry to get the mobo repaired.

Call me paranoid, but I'd never take a computer for repair with a HDD full of info. 1st time I've run into something I can't fix by myself.

1) I cannot get my XP desktop to boot from pulled 7 HDD via USB adapter (changed order in BIOS).

2) Could I just copy whole (extra) HDD contents to desktop (temp.) and then install XP on it, just for tech testing?

3) Would my XP desktop let me install XP on an external HDD is my main question. I have 2 licensed copies.

TIA!


My System SpecsSystem Spec
.
20 Jul 2011   #22
Teh Sushi Chef

Windows 7 Home Premium x64
 
 

Quote   Quote: Originally Posted by tylor View Post
at least I have now got a work-around...
Hello guys, does anyone have any information about this work-around, or the code they used for the registry script?





The code for the original tweak is as follows:
Quote:
[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"Extended"=""
"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\Directory\shell\runas]
@="Take Ownership"
"Extended"=""
"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"
Since it uses the wildcard (*) in HKEY_CLASSES_ROOT, that should mean that this script is redefining the "runas" command for ALL file extensions, in addition to renaming "Run as Administrator" as "Take Ownership," right?

So essentially for .exe files the script is saying:
Quote:
[HKEY_CLASSES_ROOT\exefile\shell\runas]
@="Take Ownership"
"Extended"=""
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\exefile\shell\runas\command]a
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
which in essence rewrites the "runas" command??

Does it need to do this because windows will only run a script like that under the alias of a trusted windows command, "runas?"
The reason I ask is that I tried to create my own work-around that would run the take ownership script without overwriting the "runas" entry and it did not seem to work. That being said, this really is some of my first exposure to scripting or programming of any kind so I may have done it incorrectly... :

Quote:
[HKEY_CLASSES_ROOT\exefile\shell\Take Ownership]
@="Take Ownership"
"Extended"=""
"NoWorkingDirectory"=""

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

Essentially, I guess that I am asking two things. What is the proper registry script for a workaround of this issue, and why is a workaround necessary in the first place?
My System SpecsSystem Spec
20 Jul 2011   #23
James Colbert

 
 

Quote   Quote: Originally Posted by tylor View Post
Ok so I uninstalled the take ownership reg tweak I implemented and tried the one posted above, unfortunately the same problem occurs - Take Ownership works great but run as admin is missing.

So I checked the tutorial section of the forum in relation to context menu tweaks and I have managed to implement a work-around so I can have both features on the right click context menu.
:->
If it gives you problems again, another workaround is to highlight the file you wish to run as admin and, from the keyboard: ctrl+shift+enter.
My System SpecsSystem Spec
.

Reply

 Take Ownership tweak removes Run as Admin




Thread Tools




Similar help and support threads
Thread Forum
PC Reverts to Old Settings and removes any changes after EVERY reboot
Good morning, I'm having an issue with a Windows 7 | 64Bit PC that I've been unable to resolve after several days of continuous troubleshooting. The computer is for a customer and was put together by their former IT guy so it'll be difficult to elaborate on various hardware components if asked;...
General Discussion
Cannot take ownership even though I'm admin
Hello, First of all I have no idea which category this lies under. So I'm hoping this one is okay. I downloaded and installed a new theme on my computer (Windows 7) which went fine. But I also wanted to get the borders and arrows. Here comes the problem; I know I have to replace the...
Customization
Iconpackager Removes Shield Overlay
As the title says Stardock's Iconpackager removes the shield overlay from programs that need to be installed as administrator. I run the only account on my system it is an administrator account. Is the shield overlay only aesthetic? Will all programs I install on my admin account be installed as...
Software
System restore removes malware?
Hello! Does a system restore disc or USB removes malware or any viruses? Thank you
System Security
MSE finds and removes Trojan three times
While on a reputable site for my local newspaper MSE signaled it found TrojanDownloader:JS/Qakbot.H, classifying it as severe. I told it to remove it and it said it succeeded. Ran a Quick Scan right away which came up clean. 12 hours later when I ran CCleaner to clean temp files MSE again found...
System Security


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 12:11.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App