I want to disable/enable powershell with reg key (if it is possible) to execute in cmd
For example. If I want to disable/enable WSH, simply i run in cmd with privileged:
:: Disable WSH
reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 0 /f
:: Restore WSH
reg add "HKLM\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows Script Host\Settings" /v Enabled /t REG_DWORD /d 1 /f
How do I do this to disable/enable Powershell? (in Windows XP/7/8/8.1/10 x86 x64)
Thanks