Question/help about take ownership context menu - excluding ext device

Page 2 of 2 FirstFirst 12

  1. Posts : 787
    Windows 7
       #11

    Brink said:
    I'm not aware of a way to make it compatible for any language since the "Yes" (Y) parameter in the commands are language specific.
    While it's possible to modify the reg file's run-time commands to handle non-English locales, it's hideously ugly. A simpler answer is to write a PS wrapper to replace all "takeown /d y" instances with a localized string for "Yes".

    For example, in Spanish -- it's /d s for Si.
    Code:
    C:\Users\GARLIN\Downloads>FixRegFile.bat Add_Take_Ownership_with_Pause_to_context_menu.reg
    
    Windows Registry Editor Version 5.00
    
    ; Created by: Shawn Brink
    ; Created on: January 28t, 2015
    ; Updated on: January 11, 2021
    ; Tutorial: https://www.tenforums.com/tutorials/3841-add-take-ownership-context-menu-windows-10-a.html
    
    
    
    [-HKEY_CLASSES_ROOT\*\shell\TakeOwnership]
    [-HKEY_CLASSES_ROOT\*\shell\runas]
    
    [HKEY_CLASSES_ROOT\*\shell\TakeOwnership]
    @="Take Ownership"
    "Extended"=-
    "HasLUAShield"=""
    "NoWorkingDirectory"=""
    "NeverDefault"=""
    
    [HKEY_CLASSES_ROOT\*\shell\TakeOwnership\command]
    @="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l & pause'
    -Verb runAs\""
    "IsolatedCommand"= "powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" && icacls \\\"%1\\\" /grant *S-1-3-4:F /
    t /c /l & pause' -Verb runAs\""
    
    
    
    [HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership]
    @="Take Ownership"
    "AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\Users\" OR System.ItemPathDisplay:=\"C:\\ProgramData\" OR System.ItemPathDisplay:=\"C:\\Windows\" OR System.Item
    PathDisplay:=\"C:\\Windows\\System32\" OR System.ItemPathDisplay:=\"C:\\Program Files\" OR System.ItemPathDisplay:=\"C:\\Program Files (x86)\")"
    "Extended"=-
    "HasLUAShield"=""
    "NoWorkingDirectory"=""
    "Position"="middle"
    
    [HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership\command]
    @="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" /r /d s && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l /
    q & pause' -Verb runAs\""
    "IsolatedCommand"="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" /r /d s && icacls \\\"%1\\\" /grant *S-1-
    3-4:F /t /c /l /q & pause' -Verb runAs\""
    
    
    
    [HKEY_CLASSES_ROOT\Drive\shell\runas]
    @="Take Ownership"
    "Extended"=-
    "HasLUAShield"=""
    "NoWorkingDirectory"=""
    "Position"="middle"
    "AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\\")"
    
    [HKEY_CLASSES_ROOT\Drive\shell\runas\command]
    @="cmd.exe /c takeown /f \"%1\\\" /r /d s && icacls \"%1\\\" /grant *S-1-3-4:F /t /c & Pause"
    "IsolatedCommand"="cmd.exe /c takeown /f \"%1\\\" /r /d s && icacls \"%1\\\" /grant *S-1-3-4:F /t /c & Pause"
    Question/help about take ownership context menu - excluding ext device Attached Files
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:05.
Find Us




Windows 10 Forums