Some Registry Help needed

Discussion in 'Application Software' started by Smorgan, May 29, 2015.

  1. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #1 Smorgan, May 29, 2015
    Last edited by a moderator: Apr 20, 2017
    Ok guys I need a way to make this work:

    This is supposed to replace CMD with Powershell (run in powershell):

    Code:
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cmd.exe"
    New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cmd.exe" -Name Debugger -Value "C:\WINDOWS\SYSTEM32\WindowsPowerShell\V1.0\powershell.exe" -PropertyType String -Force | out-null
    However when I launch cmd.exe which redirects to powershell. I get a powershell window that simply starts eating ram immediately. Eventually Windows starts to run low on ram as well. What do you guys think?
     
  2. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    Shouldn't the last line have -Name PowerShellPath instead of -Name Debugger?
     
  3. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #3 Smorgan, May 29, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Guardian it must be set to debugger in order to replace the cmd correctly. It can't be set as anything else.

    I also tried this:

    Code:
    New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\cmd.exe" -Name Debugger -Value "Powershell" -PropertyType String -Force | out-null
    However I get the same error because it just keeps launching instances of powershell.
     
  4. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    Oh, I understand now...will have to do some reading.
     
  5. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    Basically we need to figure out how powershell executes on opening. At the moment I think what is happening is that effectively when cmd is called it redirects to powershell. Then you have multiple instances launching which overload the disk usage then the RAM. After that the gui crashes. At the moment we'll just ignore that this is a glorious way to kill windows lol.
     
  6. Michaela Joy

    Michaela Joy MDL Crazy Lady

    Jul 26, 2012
    4,071
    4,651
    150
    #6 Michaela Joy, May 29, 2015
    Last edited: May 29, 2015
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #7 Smorgan, May 31, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)