バッチファイル(.bat)に拡張子を変えて実行すると動きます。
私は「SystemRepair.bat」と名前を付けました。
会社のPCがおかしくなった人に使ってもらってます。
以下が、そのスクリプトです。
@echo off
net session >nul 2>&1
if %errorLevel% == 0 (
echo Running System File Checker...
sfc /scannow
echo Running Deployment Image Servicing and Management tool...
DISM.exe /Online /Cleanup-image /Restorehealth
echo Press any key to close this window...
pause >nul
) else (
powershell -Command "Start-Process cmd -ArgumentList '/c %~f0' -Verb runAs"
)
More than 1 year has passed since last update.
DISM.exe /Online /Cleanup-image /Restorehealth sfc /scannowスクリプトの実行を許可するところまでは、動きました。
Posted at
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme