mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
Add unregister function, Add 'Background' Registry keys
Adding the registry keys that match the c++ code in the cmder.exe call /REGISTER ALL and /UNREGISTER ALL. USER is untested.
This commit is contained in:
parent
67de97a492
commit
49cc35bccf
@ -87,6 +87,23 @@ function Register-Cmder(){
|
|||||||
New-ItemProperty -Path "HKCR:\Directory\Shell\Cmder" -Force -Name "Icon" -Value `"$icon`"
|
New-ItemProperty -Path "HKCR:\Directory\Shell\Cmder" -Force -Name "Icon" -Value `"$icon`"
|
||||||
New-ItemProperty -Path "HKCR:\Directory\Shell\Cmder" -Force -Name "NoWorkingDirectory"
|
New-ItemProperty -Path "HKCR:\Directory\Shell\Cmder" -Force -Name "NoWorkingDirectory"
|
||||||
New-Item -Path "HKCR:\Directory\Shell\Cmder\Command" -Force -Value "`"$PathToExe`" `"$Command`" "
|
New-Item -Path "HKCR:\Directory\Shell\Cmder\Command" -Force -Value "`"$PathToExe`" `"$Command`" "
|
||||||
|
|
||||||
|
New-Item -Path "HKCR:\Directory\Background\Shell\Cmder" -Force -Value $MenuText
|
||||||
|
New-ItemProperty -Path "HKCR:\Directory\Background\Shell\Cmder" -Force -Name "Icon" -Value `"$icon`"
|
||||||
|
New-ItemProperty -Path "HKCR:\Directory\Background\Shell\Cmder" -Force -Name "NoWorkingDirectory"
|
||||||
|
New-Item -Path "HKCR:\Directory\Background\Shell\Cmder\Command" -Force -Value "`"$PathToExe`" `"$Command`" "
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Unregister-Cmder{
|
||||||
|
Begin
|
||||||
|
{
|
||||||
|
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
|
||||||
|
}
|
||||||
|
Process
|
||||||
|
{
|
||||||
|
Remove-Item -Path "HKCR:\Directory\Shell\Cmder" -Recurse
|
||||||
|
Remove-Item -Path "HKCR:\Directory\Background\Shell\Cmder" -Recurse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user