feat: 初回コミット (scripts)
This commit is contained in:
commit
548655a099
3 files changed
+56
No files matched your search
@@ -0,0 +1,4 @@
|
||||
# Logs and temporary files
|
||||
*.log
|
||||
*.tmp
|
||||
.vs/
|
||||
@@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
setlocal
|
||||
chcp 932 > nul
|
||||
echo ========================================================
|
||||
echo WSL サービスのクラッシュ時自動再起動設定 (管理者権限)
|
||||
echo ========================================================
|
||||
echo.
|
||||
|
||||
net session >nul 2>&1
|
||||
if %errorlevel% neq 0 (
|
||||
echo [情報] 管理者権限に昇格して実行します...
|
||||
powershell -NoProfile -Command "Start-Process cmd.exe -ArgumentList '/c \"\"%~f0\"\"' -Verb RunAs"
|
||||
exit /b
|
||||
)
|
||||
|
||||
echo [実行中] WSLService のクラッシュ時自動再起動を設定しています...
|
||||
sc.exe failure WSLService reset= 86400 actions= restart/3000/restart/5000/restart/10000
|
||||
|
||||
echo.
|
||||
echo [確認] 現在の障害回復設定:
|
||||
sc.exe qfailure WSLService
|
||||
|
||||
echo.
|
||||
echo ========================================================
|
||||
echo 設定が完了しました。何かキーを押すと閉じます。
|
||||
echo ========================================================
|
||||
pause
|
||||
@@ -0,0 +1,25 @@
|
||||
# 管理者権限の確認と自動昇格
|
||||
$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
||||
if (-not $isAdmin) {
|
||||
Write-Host "[情報] 管理者権限に昇格して再実行します..." -ForegroundColor Yellow
|
||||
Start-Process powershell.exe -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
|
||||
exit
|
||||
}
|
||||
|
||||
Write-Host "========================================================" -ForegroundColor Cyan
|
||||
Write-Host "WSL サービスのクラッシュ時自動再起動設定 (管理者権限)" -ForegroundColor Cyan
|
||||
Write-Host "========================================================" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
Write-Host "[実行中] WSLService の障害回復設定を更新しています..." -ForegroundColor Green
|
||||
& sc.exe failure WSLService reset= 86400 actions= restart/3000/restart/5000/restart/10000
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "[確認] 現在の障害回復設定:" -ForegroundColor Green
|
||||
& sc.exe qfailure WSLService
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "========================================================" -ForegroundColor Cyan
|
||||
Write-Host "設定が完了しました。Enterキーを押すと終了します。" -ForegroundColor Cyan
|
||||
Write-Host "========================================================" -ForegroundColor Cyan
|
||||
Read-Host
|
||||
Reference in new issue
Block a user