Open Regedit directly to a key.

Discussion in 'Windows 8' started by Mr Jinje, Oct 14, 2012.

  1. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,088
    60
    #1 Mr Jinje, Oct 14, 2012
    Last edited by a moderator: Apr 20, 2017
  2. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,088
    60
    #2 Mr Jinje, Oct 14, 2012
    Last edited by a moderator: Apr 20, 2017
    (OP)
  3. PaulDesmond

    PaulDesmond MDL Magnet

    Aug 6, 2009
    6,993
    7,143
    240
    The day is not over ... rofl
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Dave-UK

    Dave-UK MDL Junior Member

    Apr 24, 2011
    72
    20
    0
    Is the command supposed to be all on one line ?
     
  5. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,088
    60
    #5 Mr Jinje, Oct 15, 2012
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Yes and no. Yes, it's supposed to be on one line like that so it can run from the registry. No, it's not a normal command line, it will not work from the cmd.exe prompt without modification (mainly the removal of registry escape characters).

    Here is .cmd and .ps1 version, not as clean IMO as this will require an actual file on your computer vs the shell ext using the registry to store the snippet.

    .cmd
    Code:
    
    start /wait /b powershell -command "Clear-Host;$CLIPPY = PowerShell -NoProfile -STA -Command {[reflection.assembly]::loadwithpartialname('PresentationCore') | Out-Null;[Windows.Clipboard]::GetText()};$CLIPPY = $CLIPPY | Foreach-Object {$_ -replace 'HKCU', 'HKEY_CURRENT_USER'};$CLIPPY = $CLIPPY  | Foreach-Object {$_ -replace 'HKLM', 'HKEY_LOCAL_MACHINE'};$CLIPPY = $CLIPPY  | Foreach-Object {$_ -replace 'HKCR', 'HKEY_CLASSES_ROOT'};Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit' -Name LastKey -Value $CLIPPY;regedit.exe /m;"
    
    exit
    
    
    .ps1
    Code:
    Clear-Host;$CLIPPY = PowerShell -NoProfile -STA -Command {[reflection.assembly]::loadwithpartialname('PresentationCore') | Out-Null;[Windows.Clipboard]::GetText()};$CLIPPY = $CLIPPY | Foreach-Object {$_ -replace 'HKCU', 'HKEY_CURRENT_USER'};$CLIPPY = $CLIPPY  | Foreach-Object {$_ -replace 'HKLM', 'HKEY_LOCAL_MACHINE'};$CLIPPY = $CLIPPY  | Foreach-Object {$_ -replace 'HKCR', 'HKEY_CLASSES_ROOT'};Set-ItemProperty -Path 'registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit' -Name LastKey -Value $CLIPPY;regedit.exe /m;
    
    #
    
     
  6. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,088
    60
    #6 Mr Jinje, Oct 15, 2012
    Last edited by a moderator: Apr 20, 2017
    (OP)
  7. Veegertx

    Veegertx MDL Junior Member

    Jul 23, 2009
    63
    17
    0
    #7 Veegertx, Oct 16, 2012
    Last edited by a moderator: Apr 20, 2017
    Neat trick M8 but

    Not showing me both sides of the registry. Example
    Code:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    32 bit CurrentVersion\Run
    86  Current Version Run.jpg
    64 bit CurrentVersion\Run. Yours shows this side
    64 Current Version Run.jpg

    The way I do that with my little Jump2reg program is Wow64RevertWow64FsRedirection

    Might have to borrow that from you and maybe redirect it into my program, :D always looking to improve it.
    I remember you saying I ought to capture the reg string if someone highlight in Doze and send to my app but I have had too much to chew on.

    EDIT: I have the .wimrightclick finished but haven't uploaded yet. Using some of your stuff in it.
     
  8. Josh Cell

    Josh Cell MDL Developer

    Jan 8, 2011
    3,519
    7,110
    120
    If your runtime is .NET, the Registry class have a method to write a reg in x64 areas...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. nijel

    nijel MDL Junior Member

    Mar 8, 2008
    56
    6
    0
    #9 nijel, Oct 16, 2012
    Last edited by a moderator: Apr 20, 2017
  10. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,088
    60
    #10 Mr Jinje, Oct 16, 2012
    Last edited: Oct 17, 2012
    (OP)
    Slow and Steady wins the race.

    That sounds like something I would have suggested, guess after 3 years I finally got around to doing it myself. I'm nothing if not persistent. Go ahead and steal it, it's not a problem.
     
  11. Veegertx

    Veegertx MDL Junior Member

    Jul 23, 2009
    63
    17
    0
    #11 Veegertx, Oct 16, 2012
    Last edited: Oct 16, 2012
    Nircmd, yeah I used a long time ago but I want something easy instead of commandline.

    Yeah that was a long time back you mentioned that.

    If you wanted to fix and I guess just have a second clickable link?
    "Open 32 bit Registry Gangnam Style"

    As much as I tinker in the registry tracing program installation changes guess still need to use mine for my bookmarks, ability to search, it's tiny. All in one

    Jump2reglinks.jpg
     
  12. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,088
    60
    #12 Mr Jinje, Sep 3, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  13. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,088
    60
    #13 Mr Jinje, Sep 9, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
  14. hb860

    hb860 MDL Addicted

    May 7, 2010
    996
    1,809
    30
    #14 hb860, Sep 9, 2013
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. Veegertx

    Veegertx MDL Junior Member

    Jul 23, 2009
    63
    17
    0
    #15 Veegertx, Sep 16, 2013
    Last edited by a moderator: Apr 20, 2017
    Is that all you need and the keys will be writeable?
    Off the top of my head Trusted Installer owns this Full. I usually use setacl change then set back
    HKCR\CLSID\{323CA680-C24D-4099-B94D-446DD2D7249E}\ShellFolder