Created
November 10, 2020 10:15
-
-
Save the-takeo/0b937f2f60dec959fab7c6d26f19d9e1 to your computer and use it in GitHub Desktop.
AutoSlmgr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 期限切れ状態を取得。 | |
# 期限切れの場合は「通知」という文字列が現れるので、resultが0以外になる。 | |
$result = (cscript //Nologo C:\Windows\System32\slmgr.vbs /dli | Where-Object{$_ -Like "*通知*" }).length | |
if($result -ne 0) | |
{ | |
slmgr -rearm | |
Restart-Computer -Force | |
} | |
else | |
{ | |
#何もしない | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
試用版Windowsの試用期間が切れたときに自動延長する。日本語環境限定。
日次でタスクスケジューラ等で動かすと試用期間切れを防ぐことが出来る。
長期間に渡る試用での利用を想定している。悪用厳禁。