我想禁用/啓用powershell與reg鍵(如果可以的話)在cmd中執行使用reg鍵禁用/啓用powershell
例如。如果我想啓用/禁用WSH,只是我在cmd中運行帶有特權:
:: 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
我怎麼這個禁用/啓用PowerShell的? (在Windows XP/7/8/8.1/10 86 64)
感謝
參見[PowerShell中說:「腳本執行這個系統上禁用。」](http://stackoverflow.com/a/26955050) – wOxxOm
原諒我,我看到了鏈接,不明白我米不知道這涉及到我的問題,我的問題是關閉從cmd的關鍵reg powershell它可能更具體和描述的過程。謝謝 – BrianC
它顯示並解釋了PS執行策略的可能值。有很容易使用的註冊表/ GPO示例:[1](https://codelucidate.wordpress.com/powershell/change-execution-policy-in-the-registry/),[2](http://www.techrepublic .COM /博客/的企業雲/套最PowerShell的執行策略,通過組策略/)。 – wOxxOm