Take Ownership in Windows Developer Preview 8102

Discussion in 'Windows 8' started by 0mar32, Sep 19, 2011.

  1. 0mar32

    0mar32 MDL Novice

    Jan 14, 2011
    11
    0
    0
    I can't take ownership of files in the new Developer Preview. So how do I do it ?
     
  2. Chris123NT

    Chris123NT MDL Expert

    Oct 23, 2010
    1,070
    793
    60
    takeown /f filename

    in an elevated command prompt
     
  3. Mikeanak12

    Mikeanak12 MDL Novice

    Sep 16, 2011
    4
    1
    0
    Mouse right click on object (folder, file), then Properties - Security, click on Advanced button. On upper side of Advanced Security Settings windows on Owner string click Change. Select the new owner. :biggrin::biggrin:.
     
  4. nexus76

    nexus76 MDL Addicted

    Jan 25, 2009
    788
    300
    30
    #5 nexus76, Sep 20, 2011
    Last edited by a moderator: Apr 20, 2017
    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"
    
    
    copy this code to a txt file, save and rename it to takeown.reg / if you're to lazy take that » View attachment Taking Ownership.zip
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Shenj

    Shenj MDL Expert

    Aug 12, 2010
    1,556
    656
    60
    #6 Shenj, Sep 20, 2011
    Last edited by a moderator: Apr 20, 2017
    But as always, setting as runas removes "Run as Administrator" from context menu.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. nexus76

    nexus76 MDL Addicted

    Jan 25, 2009
    788
    300
    30
    runas.jpg takeown.jpg I'm interested how would you runas a dll file ... I don't see issues, "run as administrator" is still available for executables (.exe)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Shenj

    Shenj MDL Expert

    Aug 12, 2010
    1,556
    656
    60
    #8 Shenj, Sep 20, 2011
    Last edited by a moderator: Apr 20, 2017
    Oh yeah i mixed stuff up, sorry, you are right it doesn't really matter most of the time, cause .exe .bat etc have their own "runas" which overwrites the * key, so you can access Run as Administrator there.. i totaly forgot about it ^_^

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\*\shell\runas]
    "MUIVerb"="Take Ownership"
    "HasLUAShield"=""
    "NoWorkindDirectory"=""
    "Position"="Bottom"
    "Extended"=""
    
    [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]
    "MUIVerb"="Take Ownership"
    "HasLUAShield"=""
    "NoWorkindDirectory"=""
    "Position"="Bottom"
    "Extended"=""
    
    [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"
    
    This one is mine, pretty much the same just less ugly and hidden in the Extended Menu @ bottom.

    Edit: Though what i wanted to add, If you have EnableLUA set to 0, doing it as "runas" is still wrong as you won't be able to Take Ownership of a .exe or anything with its own runas key, so in this case you want to use a different key name, but as long as EnableLUA is 1 this is not possible as as the command will not get run as admin and fail.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. nexus76

    nexus76 MDL Addicted

    Jan 25, 2009
    788
    300
    30
    NP my friend :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. spiralien

    spiralien MDL Senior Member

    Aug 25, 2009
    275
    514
    10
    #10 spiralien, Sep 21, 2011
    Last edited by a moderator: Apr 20, 2017
    Your Reg files are not ok for all languages
    For a multi language version, you must put the SID instead group name
    For example, in the French version of Windows 7, the group Administrators called "Administrateurs"
    If i use your reg files on a french version, it will not work

    In your reg file, if you replace Administrators with *S-1-5-32-544, you will get a version that will work for all languages ​​of Windows

    Code:
     Windows Registry Editor Version 5.00
    
     [HKEY_CLASSES_ROOT\*\shell\runas]
     "MUIVerb"="Take Ownership"
     "HasLUAShield"=""
     "NoWorkindDirectory"=""
     "Position"="Bottom"
     "Extended"=""
    
     [HKEY_CLASSES_ROOT\*\shell\runas\command]
     @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant *S-1-5-32-544:F"
     "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant *S-1-5-32-544:F"
    
     [HKEY_CLASSES_ROOT\Directory\shell\runas]
     "MUIVerb"="Take Ownership"
     "HasLUAShield"=""
     "NoWorkindDirectory"=""
     "Position"="Bottom"
     "Extended"=""
    
     [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
     @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant *S-1-5-32-544:F /t"
     "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant *S-1-5-32-544:F /t"
    
     
    Sorry for my poor english
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. JeepWillys58

    JeepWillys58 MDL Addicted

    Nov 6, 2010
    586
    366
    30
    #11 JeepWillys58, Dec 27, 2012
    Last edited: Dec 27, 2012
    Dear friends,

    Is there a way to do this, but changing the permissions of the owner and es folder or file in question to "everyone"?

    I searched for hours and found nothing, and the traditional method takes a long time, open the properties, security, advanced, owner = set "Everyone", then permissions, delete everything and add "everyone" full control, subfolders, etc ... a lot of work ...

    Anyone have any ideas?

    PS 1: I've tried via admin prompt, and ICACLS takeown, but also is very laborious and time consuming ...:(

    PS2: I have to do this in all my HDDs customers and 18 2TB HDDs from my file server ...:weeping:

    Please help me ...

    Regards
    Marcelo "Sushi"

    I also tried using the Security Identifier (SID) S-1-1-0, but still giving the user administrator active as owner of the file ...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. 8907654738

    8907654738 MDL Novice

    Jul 23, 2018
    8
    3
    0
    One question, does anyone know how to delete the tokens and store folders in the spp folder inside System32 in Windows Developer Preview? I took ownership of them, and when I try to delete them it says that you need permission from Administrators to delete the folders and files when I'm the administrator. I also tried to use the Command Prompt of the recovery options of Windows 7, and then tried to delete them with the command del and nothing happens. What's the problem?