LoginSignup
0
0

More than 1 year has passed since last update.

powershellでレジストリの設定を無限に変更し続けるスクリプトを作った。

Posted at

はじめに

Windowsサーバーで作業する際に、「プロキシサーバーを使う」がオンの状態で実施する作業があるのですが、作業中にほかの人にオフにされて煩わしいので作った。結局怖くて使ってない。
きっと誰の役にも立たない。作ってる時も特にハマることはなかった。

中身

proxy.ps1
$regPath = "Registry::HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings"


while($true){
    $ProxyEnable = (Get-Item -Path $regPath).GetValue("ProxyEnable") 

    if($ProxyEnable -eq 0){
        echo $ProxyEnable
        Set-ItemProperty -Path $regPath -name ProxyEnable -Value 1

    }else{
        echo $ProxyEnable
    }
    Start-Sleep -s 1
}

おわりに

powershellでレジストリいじったことなかったから勉強にはなりました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0