0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

DISM.exe /Online /Cleanup-image /Restorehealth sfc /scannowスクリプトの実行を許可するところまでは、動きました。

Posted at

バッチファイル(.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"
)

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?