使用故障恢复控制台修复不能启动的Windows系统.docx
《使用故障恢复控制台修复不能启动的Windows系统.docx》由会员分享,可在线阅读,更多相关《使用故障恢复控制台修复不能启动的Windows系统.docx(9页珍藏版)》请在冰豆网上搜索。
使用故障恢复控制台修复不能启动的Windows系统
使用故障恢复控制台修复不能启动的Windows系统
我们这里介绍的方法在原理上来说十分简单,即首先将Boot.ini文件删除,然后通过“BootCfg/Rebuild”命令将其重建,在重建的过程中,BootCfg同时也会修复在本文开篇所列出的多种可能损坏的系统文件,最后使用FixBoot写入新的启动扇区。
通过这样的方法,只需简单的8条命令,即可修复绝大多数Windows系统不能正常启动的故障。
下面我们分步骤详细解释。
删除Boot.ini文件
首先,上面我们说过,进入系统控制台后,默认工作目录为系统目录,如果Windows安装在C:
盘时,即“c:
windows”,而Boot.ini文件在根目录上,此时我们需要进入上一级目录:
命令1:
cd..
Boot.ini是一个相当重要的系统文件,因此,在未解除系统对其的保护状态前,我们是不能对其进行删除操作的。
要做到这一点,需要运行三条命令,依次解除其隐含、只读和隐含属性,这样才能最终将其删除。
命令2:
ATTRIB–HC:
BOOT.INI
命令3:
ATTRIB–RC:
BOOT.INI
命令4:
ATTRIB–SC:
BOOT.INI
命令5:
DELBOOT.INI
删除boot.ini的步骤
使用BootCfg修复启动故障
现在到了最重要的步骤,运行:
命令5:
BOOTCFG/REBUILD
该命令将遍历系统的安装设置,修复其中的故障部分,纠正导致Windows不能正常启动的一系列错误,并重建Boot.ini文件。
在Boot.ini重建结束后,将出现“EnterOSLoadOptions:
”输入栏,这时,为保证系统的正常启动,需要注意的是:
1、对WindowsXP用户而言,必须添加/FASTDETECT选项。
2、如果系统的CPU支持Intel的XD或AMD的NX功能,必须添加/NOEXECUTE=OPTIN选项。
在下面图示的例子中,为说明方便,同时添加了上面两个开关选项,不过,切记,如果您的CPU不支持相应的功能,千万不要添加NOEXECUTE选项,不然,会造成系统启动的故障。
而“EnterLoadIdentifier”部分,则相对关系不大,输错也没有太大的影响。
当然,如果您是一个完善主义者,则可如图例中输入完整的如“MicrosoftWindowsXPHomeEdition”之类,显得比较规。
使用BootCfg/Rebuild重建boot.ini
进行磁盘检查
这一步骤将检查系统分区的完整性,虽然从某种意义上说,这一步骤并不是必需的,不过,确保系统硬盘能够运转正常,没有坏扇区,也是保证Windows系统长期安全的必要手段。
命令很简单:
命令7:
CHKDSK/R/F
该命令的运行时间根据机器配置的不同而变化,在某些较为古老的PC的甚至可能会超过半个小时。
写入新的引导扇区
命令8:
FIXBOOT
该命令将清除修复过程可能造成的影响系统运行的因素,重写硬盘的引导扇区。
当出现“SureyouwanttowriteanewbootsectortothepartitionC:
?
”提示时敲入“Y”确认即可。
这样,我们的修复过程即宣告完成。
在故障恢复控制台中输入“EXIT”以重启系统,您会惊奇地发现Windows系统能够正常启动,曾经出现的如DLL、注册表项、或NTLDR之类的错误奇迹般消失了。
通过这样的方法,可以避免重装Windows之类的繁琐劳动,节省您的时间。
RepairingWindowsXPinEightCommands
Mostofushaveseenitatonetimeoranother;perhapsonourownPC,thePCofalovedone,orperhapsaPCatyourplaceofemployment.Thesystemspendsweeksormonthsoperatinginasmoothfashion,takingyoutothefarreachesofthewide,wibblyweb,andafteroneparticularlylateeveningofbrowsingandgaming,youshutyourPCoffandgotobed.Millionsofpeopleacrosstheglobedojustthiseverynight,butafewofushaveturnedourPCsonthenextdaynottothestandardWindowsXPloadingscreen,butinsteadthisdreadederror:
Windowscouldnotstartbecausethefollowingfileismissingorcorrupt:
\WINDOWS\SYSTEM32\CONFIG\SYSTEM
YoucanattempttorepairthisfilebystartingWindowsSetup
usingtheoriginalSetupCD-ROM.
Select‘R’atthefirstscreentostartrepair.
WhichrendersyourPCinaccessiblefromthestandardbootproceduresofWindowsXP.Youtrysafemode,tonoavail.You’reparticularlysavvyandtryissuingtheFIXBOOTandFIXMBRcommandsintheWindowsrecoveryconsole,butaftereachreboot,you’remerelygreetedwiththesameobnoxiousandterrifyingbluescreenofdeaththat’spreventingyoufromaccessingyourpreciousdata.
Perhapsyou’vealsoseentheseerrorscreens:
WindowsNTcouldnotstartbecausethebelowfileismissingorcorrupt:
X:
\WINNT\System32\Ntoskrnl.exe
_________________
WindowsNTcouldnotstartbecausethebelowfileismissingorcorrupt:
X:
\WINNT\System32\HAL.dll
_________________
NTLDRisMissing
Pressanykeytorestart
_________________
Invalidboot.ini
Pressanykeytorestart
Allowmetobuildtensionbyprefacingtheend-all/be-allsolutionwithmybackground:
Havingworkedforthenow-incorporatedGeekSquadbranchofBestBuyCorporationforthebetterpartofeightmonths,Ihaveseendozensupondozensofsystemscomethroughourdepartmentwithanyoneoftheseerrors,broughtinbycustomerswhoareafraidtheydidsomething,haveavirus,orareinjeopardyoflosingtheirdata.Priortomydiscoveryofaninvaluablesequenceofcommands,ourstandardprocedurewastohooktheafflicteddrivetoanexternalenclosure,backupacustomer’sdataandthenrestorethePCwiththecustomer’srestorediscsoranidenticalcopyofWindowswiththecustomer’sOEMlicensekey.Ifthecustomerwasn’tkeenontheapplicablechargesforthedatabackup,weinformedthemofthepotentialrisksforaWindowsrepairinstallation(Let’sfaceit,theydon’talwaysworkright),hadthemsignawaiver,andwedidourbest.
NeitheroftheseproceduresarecheapintherealmofcommercialPCrepair,nordotheyinspireatremendouslevelofconfidenceinthetechnicianorthehopefulclient.
Inanefforttoexpediteourrepairtimeandretainthesanityofmyselfandothertechnicians,IreceivedpermissiontoundertakeacasestudyonavarietyofPCscurrentlyinservicethatexhibitedanyoftheaforementionedsymptoms,andItookituponmyselftofindabettersolution.AftercrawlingthroughtheMSKB,ExpertsExchange,MSDNandsundrywebsitesallextollingthevirtuesofasolutiontotheseproblems,Ionlyfoundonethatworked,andithasbeenreliablyservingmeforthebetterpartoftwoweeksonseventeenPCstodate.
Theprocessissimple:
GettotheWindowsRecoveryConsoleforyourparticularWindowsinstallation,navigatetotherootletterofyourinstallation(C:
inmostcases),issueeightcommands,andreboot.Thecornerstoneofthisprocessisacommandcalled“BOOTCFG/Rebuild”whichisacompletediagnosticoftheoperatingsystemloadedintotherecoveryconsole;thepurposeofthecommandistoremove/replace/repairanysystemfilesthatwerepreventingtheoperatingsystemfromloadingcorrectly.Amongstthefilesitfixesare:
∙WindowsHardwareAbstractionLayer(HAL)
∙Corruptregistryhives(\WINDOWS\SYSTEM32\CONFIG\xxxxxx)
∙InvalidBOOT.INIfiles
∙AcorruptNTOSKRNL.EXE
∙AmissingNTLoader(NTLDR)
ThecommandprocessmayapplytoothertypesofbluescreensorHive/HAL/INI/EXE/DLL-relatedstoperrors,butIhavenothadtheluxuryofcomputersinthistypeofdisrepair.TheprocessIamabouttooutlineisvirtuallyharmless,andifyoufeelyoumaybeabletocorrectyourPC’sboot-timebluescreensandstoperrorswiththesequence,feelfreetotry.
Letusnowbeginwithastep-by-stepinstructionforcorrectingtheseissues.
GettingtotheWindowsRecoveryConsole
1.InsertyourWindowsXPCDintoyourCDandassurethatyourCD-ROMdriveiscapableofbootingtheCD.ConfiguringyourcomputertobootfromCDisoutsideofthescopeofthisdocument,butifyouarehavingtrouble,consultGoogleforassistance.
2.OnceyouhavebootedfromCD,donotselecttheoptionthatstates:
“PressF2toinitiatetheAutomatedSystemRecovery(ASR)tool.”You’regoingtoproceeduntilyouseethefollowingscreen,atwhichpointyouwillpressthe“R”keytoentertherecoveryconsole:
∙Afteryouhaveselectedtheappropriateoptionfromsteptwo,youwillbepromptedtoselectavalidWindowsinstallation(Typicallynumber“1”).Selecttheinstallationnumber,(Asmentioned,“1”inmostcases),andhitenter.Ifthereisanadministratorpasswordfortheadministratoraccount,enteritandhitenter.Youwillbegreetedwiththisscreen,whichindicatesarecoveryconsoleattheready:
Continuetopage2toproceedwiththerepairfunctions.
[newpage]
ProceedingWiththeRepairFunctions
∙ThereareeightcommandsyoumustenterinsequencetorepairanyoftheissuesInotedintheopeningofthisguide.Iwillintroducethemhere,andthenshowtheresultsgraphicallyinthenextsixsteps.Thesecommandsareasfollows:
oC:
CD..
oC:
ATTRIB–HC:
\boot.ini
oC:
ATTRIB–SC:
\boot.ini
oC:
ATRIB–RC:
\boot.ini
oC:
delboot.ini
oC:
BOOTCFG/Rebuild
oC:
CHKDSK/R/F
oC:
FIXBOOT
∙To“Goupadirectory”incomputingistorevertbacktothedirectoryabovethecurrentfolderyou’reoperatingin.If,forexample,I’mintheC:
WINDOWSSYSTEM32directory,andIwanttogetatafileintheWINDOWSdirectory,IwouldmerelytypeCD..andIwouldbetakenoutoftheSYSTEM32folderanduponeleveltoWINDOWS.We’regoingtodothesamethingherefromtheWINDOWSfoldertogettothebasicrootofC:
∙NowthatweareatC:
wecanbegintheprocessofrepairingtheoperatingsystem
andthatbeginswithmodifyingtheattributesoftheBOOT.INIfile.Briefly,BOOT.INIcontrolswhatoperatingsystemstheWindowsbootprocesscansee,howtoloadthem,andwherethey’relocatedonyourdisk.We’regoingtomakesurethefileisnolongerhiddenfromourpryingeyes,removetheflagthatsetsitasanundeletablesystemfile,andremovetheflagthatsetsitasafilewecanonlyread,butnotwriteto.Todothis,wewillissuethreecommandsinthisstep:
∙C:
ATTRIB–HC:
\BOOT.INI
∙C:
ATTRIB–RC:
\BOOT.INI
∙C:
ATTRIB–SC:
\BOOT.INI
toremovetheHidden,SystemandReadOnlyflags.
∙Nowthatwe’vemodifiedtheattributesfortheBOOT.INIfile,it’supfordeletion.
thesyntaxforitissimple:
{DEL|FILENAME},e.g.,C:
DELBOOT.INIdeletestheBOOT.INIfile.
∙Nowforthemostimportantstepofourprocess,theBOOTCFG/REBUILD
commandwhichsearchesforpre-existinginstallationsofWindowsXPandrebuildssundryessentialcomponentsoftheWindowsoperatingsystem,recompilestheBOOT.INIfileandcorrectsalitanyofcommonWindowserrors.Itisveryimportantthatyoudooneorbothofthefollowingtwothings:
First,everyWindowsXPownermustuse/FASTDETECTasanOSLoadOptionwhentherebuildprocessisfinalizing.Secondly,ifyouaretheownerofaCPUfeaturingIntel’sXDorAMD’sNXbufferoverflowprotection,youmustalsouse/NOEXECUTE=OPTINasanOSLoadOption.Iwilldemonstratebothcommandsforthepurposeofthisguide,butdonotsetNOEXECUTEasaloadoptionifyoudonotownoneoftheseCPUs.Forthe“EnterLoadIdentifier”portionofthiscommand,youshouldenterthenameoftheoperatingsystemyouhaveinstalled.If,forexample,youareusingWindowsXPHome,youcouldtype“MicrosoftWindowsXPHomeEdition”fortheidentifier.Thisgivestheprocesssomeaut