1
1

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 3 years have passed since last update.

Windows PEでdism, sfc /scannowを実行する方法

Posted at

#Windows PEでdism, sfc /scannowを実行する方法

windows復旧でよく使うコマンドの備忘録

Windows PEについて

Windows Pre-install Environment の略.Winをインストールするときに使うインストールメディアなどで採用されている最小限構成のWindows.
ちなみにWindows RE (Windows Recovery Environment)はPEを基につくられている.
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/winpe-intro

PEでのDISMとSFC

DISMはシステムイメージのチェックと修正を
SFCはシステムファイルのチェックと修正をこころみてくれる

Windowsに不具合がありそうなときにsfc /scannowをするという手法がある.
また,それが失敗する場合,dism /online /cleanu-image /ScanHealthなどすればよいかもという話もある.

こうしたコマンドが,Windows PEではこのまま実行するとエラーに終わる.
これはおそらくこれらのコマンドが対象としている領域(大抵C:D:)がPEでブートしているところ(USBメモリX:など)とは異なるためだと思う.

そのため以下の様にチェック領域を指定すればよい

dismでチェックだけ
dism /image:c:\ /cleanup-image /scanhealth
dismで修復も試みる
dism /image:c:\ /cleanup-image /restorehealth
sfc_/scannow
c:
sfc /scannow /offbootdir=c:\ /offwindir=c:\Windows

そのほかchkdsk bootrec /fixbootなどもやってみる.

---wip

これ↓とか見ると,

GPTの場合,diskpartでEFIシステムパーティションにドライブレター(以下の例ではB:)を割りあてたうえで/offbootdir=B:とかした方がいい気がしたけど,まだ試してない

x:> diskpart
DISKPART> list vol 
DISKPART> sel vol 2 (EFIパーティションぽい奴500MBくらいでFAT32)
DISTPART> assign letter=b:
DISKPART> exit
x: sfc /scannow /offbootdir=b:\ /offwindir=c:\Windows
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?