commit 548655a099be916bf79cc17237245b482a474fc7 Author: uduki Date: Thu Oct 1 09:43:22 2026 +0900 feat: åˆ�回コミット (scripts) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e64ce8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +# Logs and temporary files +*.log +*.tmp +.vs/ diff --git a/register-service-recovery.bat b/register-service-recovery.bat new file mode 100644 index 0000000..df5ba71 --- /dev/null +++ b/register-service-recovery.bat @@ -0,0 +1,27 @@ +@echo off +setlocal +chcp 932 > nul +echo ======================================================== +echo WSL ƒT�[ƒrƒX‚̃Nƒ‰ƒbƒVƒ…ŽžŽ©“®�Ä‹N“®�Ý’è (ŠÇ—�ŽÒŒ ŒÀ) +echo ======================================================== +echo. + +net session >nul 2>&1 +if %errorlevel% neq 0 ( + echo [�î•ñ] ŠÇ—�ŽÒŒ ŒÀ‚É�¸Ši‚µ‚ÄŽÀ�s‚µ‚Ü‚·... + powershell -NoProfile -Command "Start-Process cmd.exe -ArgumentList '/c \"\"%~f0\"\"' -Verb RunAs" + exit /b +) + +echo [ŽÀ�s’†] WSLService ‚̃Nƒ‰ƒbƒVƒ…ŽžŽ©“®�Ä‹N“®‚ð�ݒ肵‚Ä‚¢‚Ü‚·... +sc.exe failure WSLService reset= 86400 actions= restart/3000/restart/5000/restart/10000 + +echo. +echo [Šm”F] Œ»�Ý‚Ì�áŠQ‰ñ•œ�Ý’è: +sc.exe qfailure WSLService + +echo. +echo ======================================================== +echo �Ý’è‚ªŠ®—¹‚µ‚Ü‚µ‚½�B‰½‚©ƒL�[‚ð‰Ÿ‚·‚ƕ‚¶‚Ü‚·�B +echo ======================================================== +pause \ No newline at end of file diff --git a/register-service-recovery.ps1 b/register-service-recovery.ps1 new file mode 100644 index 0000000..79b4e17 --- /dev/null +++ b/register-service-recovery.ps1 @@ -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 \ No newline at end of file