Author Topic: [SOLVED]Take Ownership not work!  (Read 5473 times)

0 Members and 1 Guest are viewing this topic.

Offline Angelika

  • Sr. Member
  • ****
  • Join Date: Feb 2017
  • Posts: 307
  • Karma: -2
    • View Profile
[SOLVED]Take Ownership not work!
« on: February 23, 2018, 04:35:13 am »
How to modify script so that do not click on the administrator permissions each time UAC is enabled.
There are two administrators in Windows.


Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"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"
"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"
« Last Edit: February 23, 2018, 09:22:15 am by Angelika »

Offline Boggin

  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Jul 2014
  • Posts: 10182
  • Location: UK
  • Karma: 122
    • View Profile
Re: Take Ownership not work!
« Reply #1 on: February 23, 2018, 08:17:21 am »

Offline Angelika

  • Sr. Member
  • ****
  • Join Date: Feb 2017
  • Posts: 307
  • Karma: -2
    • View Profile
Re: Take Ownership not work!
« Reply #2 on: February 23, 2018, 09:21:02 am »
Thanks, now it works well.

Offline Boggin

  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Jul 2014
  • Posts: 10182
  • Location: UK
  • Karma: 122
    • View Profile
Re: [SOLVED]Take Ownership not work!
« Reply #3 on: February 23, 2018, 10:08:53 am »
Good - a lot better than messing around with scripts.