[SOLVED] Take ownership working wierdly

Discussion in 'Windows 7' started by QuantumBug, Jun 9, 2012.

Thread Status:
Not open for further replies.
  1. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,473
    1,293
    60
    Well first of all I thought it was a bug in my application but apparently not.

    After installing 'Take Ownership.reg', when I default left click on a folder it will try and take ownership of the folder instead of letting me open the folder. I have uninstalled the tweak and reinstalled but no joy.

    'Take Ownership' is also being added to the top of the Windows context menu in bold black letters and I know it's also not supposed to be like that...

    takeown1.jpg

    Can anyone shed light on this? Will teach me to make a backup of my Registry in the future I guess :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,473
    1,293
    60
    #3 QuantumBug, Jun 9, 2012
    Last edited: Jun 9, 2012
    (OP)
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Windows Fan

    Windows Fan MDL Senior Member

    Mar 6, 2012
    352
    210
    10
    ^^ is it happening only with folders or with files as well?
     
  4. urie

    urie Moderator
    Staff Member

    May 21, 2007
    8,644
    3,003
    300
    #5 urie, Jun 9, 2012
    Last edited by a moderator: Apr 20, 2017
    Here are scripts I have used for the last few years.

    Code:
    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"
    Save as: InstallTakeOwnership.reg

    Code:
    Windows Registry Editor Version 5.00
    
    
    [-HKEY_CLASSES_ROOT\*\shell\runas]
    
    [-HKEY_CLASSES_ROOT\Directory\shell\runas]
    Save as: RemoveTakeOwnership.reg

    let me know how things work out I will message a friend who is does know about registry and context e.c.t
     
  5. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,473
    1,293
    60
    @urie

    The script you posted is exactly what is programmed into my application. The 'Take Ownership' scripts all work, but in the Windows context menu it's elevating it's position above 'Open' as you can see in the picture below...

    stupidregistry.jpg

    @Windows Fan

    No, it's only causing issues when opening or right clicking folders. If I right click a .dll, .exe etc 'Take Ownership' appears on the context menu in the correct place, see below compared to the picture above...

    takeowncorrect.jpg
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. urie

    urie Moderator
    Staff Member

    May 21, 2007
    8,644
    3,003
    300
  7. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,473
    1,293
    60
    @urie

    Haha no malware, it's something I've done fiddling around. I'm checking through all of the most elaborate 'shell' entries in ClassesRoot to see if I can spot what I've broken. Thanks for all of your help! :D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Windows Fan

    Windows Fan MDL Senior Member

    Mar 6, 2012
    352
    210
    10
    ^^ can you post what keys are stored under following key in your system:

    HKEY_CLASSES_ROOT\Directory\shell
     
  9. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,473
    1,293
    60
    #10 QuantumBug, Jun 10, 2012
    Last edited by a moderator: Apr 20, 2017
    (OP)
    @Windows Fan

    Sure thing!

    Code:
    
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory]
    @="File Folder"
    "AlwaysShowExt"=""
    "EditFlags"=hex:d2,01,00,00
    "FriendlyTypeName"="@shell32.dll,-10152"
    "FullDetails"="prop:System.PropGroup.Description;System.DateCreated;System.FileCount;System.TotalFileSize"
    "InfoTip"="prop:System.Comment;System.DateCreated"
    "NoRecentDocs"=""
    "PreviewDetails"="prop:System.DateModified;*System.SharedWith;*System.OfflineAvailability;*System.OfflineStatus"
    "PreviewTitle"="prop:System.ItemNameDisplay;System.ItemTypeText"
    
    [HKEY_CLASSES_ROOT\Directory\Background]
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell]
    
    [HKEY_CLASSES_ROOT\Directory\Background\shellex]
    
    [HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers]
    
    [HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\DropboxExt]
    @="{FB314ED9-A251-47B7-93E1-CDD82E34AF8B}"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\Gadgets]
    @="{6B9228DA-9C15-419e-856C-19E768A13BDC}"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\New]
    @="{D969A300-E7FF-11d0-A93B-00A0C90F2719}"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\Sharing]
    @="{f81e9010-6ea4-11ce-a7ff-00aa003ca9f6}"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\XXX Groove GFS Context Menu Handler XXX]
    @="{6C467336-8281-4E60-8204-430CED96822D}"
    
    [HKEY_CLASSES_ROOT\Directory\DefaultIcon]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,\
      65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,00,00
    
    [HKEY_CLASSES_ROOT\Directory\shell]
    @=""
    
    [HKEY_CLASSES_ROOT\Directory\shell\cmd]
    @="@shell32.dll,-8506"
    "Extended"=""
    "NoWorkingDirectory"=""
    
    [HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
    @="cmd.exe /s /k pushd \"%V\""
    
    [HKEY_CLASSES_ROOT\Directory\shell\find]
    "LegacyDisable"=""
    "SuppressionPolicy"=dword:00000080
    
    [HKEY_CLASSES_ROOT\Directory\shell\find\command]
    @=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
      00,5c,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,2e,00,65,00,78,00,\
      65,00,00,00
    "DelegateExecute"="{a015411a-f97d-4ef3-8425-8a38d022aebc}"
    
    [HKEY_CLASSES_ROOT\Directory\shell\takeownership]
    @="Take ownership"
    "HasLUAShield"=""
    "NoWorkingDirectory"=""
    
    [HKEY_CLASSES_ROOT\Directory\shell\takeownership\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"
    
    [HKEY_CLASSES_ROOT\Directory\shellex]
    
    [HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers]
    
    [HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\DropboxExt]
    @="{FB314ED9-A251-47B7-93E1-CDD82E34AF8B}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\EncryptionMenu]
    @="{A470F8CF-A1E8-4f65-8335-227475AA5C46}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\EPP]
    @="{09A47860-11B0-4DA5-AFA5-26D86198A780}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\Offline Files]
    @="{474C98EE-CF3D-41f5-80E3-4AAB0AB04301}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\Sharing]
    @="{f81e9010-6ea4-11ce-a7ff-00aa003ca9f6}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\WinRAR]
    @="{B41DB860-64E4-11D2-9906-E49FADC173CA}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\WinRAR32]
    @="{B41DB860-8EE4-11D2-9906-E49FADC173CA}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\XXX Groove GFS Context Menu Handler XXX]
    @="{6C467336-8281-4E60-8204-430CED96822D}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}]
    
    [HKEY_CLASSES_ROOT\Directory\shellex\CopyHookHandlers]
    
    [HKEY_CLASSES_ROOT\Directory\shellex\CopyHookHandlers\FileSystem]
    @="{217FC9C0-3AEA-1069-A2DB-08002B30309D}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\CopyHookHandlers\Sharing]
    @="{40dd6e20-7c17-11ce-a804-00aa003ca9f6}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\DragDropHandlers]
    
    [HKEY_CLASSES_ROOT\Directory\shellex\DragDropHandlers\WinRAR]
    @="{B41DB860-64E4-11D2-9906-E49FADC173CA}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\DragDropHandlers\WinRAR32]
    @="{B41DB860-8EE4-11D2-9906-E49FADC173CA}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers]
    
    [HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers\Offline Files]
    @="{7EFA68C6-086B-43e1-A2D2-55A113531240}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers\Sharing]
    @="{f81e9010-6ea4-11ce-a7ff-00aa003ca9f6}"
    
    [HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers\{1f2e5c40-9550-11ce-99d2-00aa006e086c}]
    
    [HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers\{4a7ded0a-ad25-11d0-98a8-0800361b1103}]
    
    [HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers\{596AB062-B4D2-4215-9F74-E9109B0A8153}]
    
    [HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers\{ECCDF543-45CC-11CE-B9BF-0080C87CDBA6}]
    
    [HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers\{ef43ecfe-2ab9-4632-bf21-58909dd177f0}]
    @=""
    
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. Windows Fan

    Windows Fan MDL Senior Member

    Mar 6, 2012
    352
    210
    10
    i found that the value of (Default) in right side pane is set to blank in your system for following key:

    HKEY_CLASSES_ROOT\Directory\shell

    it should be set to none. so please set (default) value to none, restart your system and check whether it fixes your problem or not.
     
  11. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,473
    1,293
    60
    HKEY_CLASSES_ROOT\Directory\shell's (Default) value is set to nothing anyhow.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. Windows Fan

    Windows Fan MDL Senior Member

    Mar 6, 2012
    352
    210
    10
    you need to type none just like any other string. so set value of (Default) to 'none'.
     
  13. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,473
    1,293
    60
    You, are, an absolute legend. I knew it would be something silly.

    Thank you, problem solved!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Windows Fan

    Windows Fan MDL Senior Member

    Mar 6, 2012
    352
    210
    10
    my pleasure. we all are here to help each other. :)