萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 作業系統 >  >> Windows XP 教學

Windows 修復主控台修復啟動故障實戰案例集

修復主控台進入方式

  1. Windows 安裝光碟啟動 → 歡迎畫面按 R
  2. 選擇 Windows 安裝 (通常 1) → 輸入 Administrator 密碼
  3. 或預先安裝至硬碟:winnt32 /cmdcons → 開機選單出現「Microsoft Windows Recovery Console」

核心指令速查 (補充文章 144248)

指令參數/範例用途
attribattrib -h -r -s C:\boot.ini修改檔案屬性 (隱唯系統)
batchbatch C:\commands.txt批次執行指令檔
bootcfg/list /scan /rebuild /default /idBoot.ini 管理
chkdsk/p /r磁碟檢查修復
copycopy D:\i386\ntldr C:\複製檔案 (支援壓縮檔自動展開)
delete/deldel C:\pagefile.sys刪除檔案
dirdir C:\ /a列出檔案 (含隱藏/系統)
disabledisable sptd停用服務/驅動 (回傳原啟動類型)
diskpart/add /delete device partition size分區管理
enableenable sshd SERVICE_AUTO_START啟用服務/驅動
expandexpand D:\i386\hal.dl_ C:\windows\system32\hal.dll解壓縮 _ 結尾檔案
fixbootfixboot C:寫入啟動扇區
fixmbrfixmbr \Device\HardDisk0修復 MBR
formatformat D: /FS:NTFS /Q格式化
helphelp 指令名說明
listsvclistsvc列出服務狀態
logonlogon切換 Windows 安裝
mapmap顯示裝置對應
mkdir/mdmd C:\temp建立目錄
more/typetype C:\boot.ini顯示檔案內容
ren/renameren ntfs.sys ntfs.old重命名
rmdir/rdrd /s C:\temp刪除目錄
setset allowallpaths=true設定環境選項 (解除路徑限制等)
systemrootsystemroot切換到 %SystemRoot%
exitexit退出重啟

五大經典故障實戰解決

案例 1:Ntfs.sys 遺失/損壞 (FAT32→NTFS 轉換後)


cd \windows\system32\drivers
ren ntfs.sys ntfs.old
copy D:\i386\ntfs.sys .
exit

案例 2:NTLDR/NTDETECT.COM 遺失


copy D:\i386\ntldr C:\
copy D:\i386\ntdetect.com C:\
# 檢查 Boot.ini
type C:\boot.ini
# 若遺失/錯誤
bootcfg /rebuild
fixboot C:

案例 3:誤刪 SAM 檔 (無法登入)


copy D:\windows\repair\sam C:\windows\system32\config\sam
# 注意:repair 版為安裝初始狀態,會丟失後建用戶
# 進入系統後立即執行「系統還原」回最新還原點

案例 4:多系統啟動菜單遺失 (Win98 覆蓋 XP 引導)


bootcfg /add
# 掃描發現安裝 → 選擇編號 → 輸入載入識別符 "Windows XP" → OS載入選項 "/fastdetect"
exit
# 若仍有其他系統,重複執行 /add

案例 5:誤刪 Boot.ini + 系統分區遷移 (C:→D:)


# 1. 掃描尋找安裝
bootcfg /scan
# 2. 重建 Boot.ini 指向 D:\WINDOWS
bootcfg /rebuild
# 3. 複製啟動檔到作用中分區 (通常 C:)
copy D:\i386\ntldr C:\
copy D:\i386\ntdetect.com C:\
# 4. 寫入啟動扇區
fixboot C:

進階技巧

  • 解除路徑限制: set allowallpaths=true、set allowwildcards=true、set allowremovablemedia=true、set nocopyprompt=true (需本機安全性原則啟用)
  • 離線註冊檔編輯: regedit → 檔案 → 載入機構 → C:\Windows\System32\config\SYSTEM / SOFTWARE / SAM / SECURITY / DEFAULT
  • 密碼重設: 同案例 3,複製 repair\sam 或用 chntpw (Linux PE)

現代替代:WinRE / WinPE

XP 修復主控台功能有限、無圖形介面、不支援現代硬體 (NVMe、UEFI、USB3)。**現代維護請使用:**

  • Windows 10/11 安裝媒體 → 修復電腦 → 疑難排解 → 命令提示字元 (WinRE)
  • Windows PE (ADK 製作 / Ventoy + WinPE ISO)
  • 指令升級版:bcdboot、bootrec /fixmbr /fixboot /scanos /rebuildbcd、diskpart、dism、sfc /offbootdir /offwindir、PowerShell 完整腳本
copyright © 萬盛學電腦網 all rights reserved