在DOS方式下維護登錄檔

2021-04-06 19:42:51 字數 2195 閱讀 3400

在windows95/98視窗環境下維護登錄檔對大多數人來說並不陌生,但是,如果碰上登錄檔損壞,以致連視窗環境都無法進入時,該怎樣對登錄檔進行維護?這裡介紹幾個在dos方式下維護登錄檔的小竅門。

登錄檔編輯器一定要在視窗環境下才能執行嗎?不!

regedit.exe在dos方式下照常可以執行。在dos方式下鍵入命令列:regedit,就會出現語法提示如下:

c:/>regedit

imports and exports registry files to and

from the registry

regedit [/l:system] [/r:user] filename1

regedit [/l:system] [/r:user] /c filename2

regedit

[/l:system] [/r:user] /e filename3 [regpath1]

regedit [/l:system]

[/r:user] /d regpath2

/l:system specifies the location of system.dat

file.

/r:user specifies the location of user.dat file.

filenamel specifies the file(s) to import into the registry.

/c filename2 specifies the file to creat the registry from..

/e filename3 specifies the file to export the registry to.

regpath1 specifies the starting registry key to export from

(defaults to exporting the entire registry).

/d regpath2

specifies the registry key to delete.

c:/>_

語法具體含義上面已經寫得很清楚,結合例子說明如何使用。

匯出登錄檔資料到一指定檔案(例如test.reg),執行命令:

c:/>regedit /e test.reg

從一指定檔案(例如test.reg)匯入登錄檔資料,執行命令:

c:/>regedit test.reg

利用system.dat檔案和user.dat檔案匯出登錄檔資料到一指定檔案,執行:

c:/>regedit

/l:c:windows /r:c:/windows/testuser/ test /e test.reg

除了dos方式下的regedit可以恢復被損壞的登錄檔檔案,完成維護工作外,windows98新增了乙個登錄檔維護工具,同樣可以勝任這一工作,它就是scanreg.exe,具有以下功能:

每次windows98啟動時,自動執行系統登錄檔檢查程式檢查登錄檔是否正確,

每天保留乙份正確的登錄檔備份,預設最多可以備份5份,即在windows的sysbackup目錄下的 rb00*.cab,損壞的登錄檔存為rbbad.cab。

刪除登錄檔中多餘資料,減小登錄檔大小。

如果檢查到登錄檔有問題,自動使用上次正確的登錄檔備份來恢復,如果連備份也沒有,它會自動修復登錄檔。

scanreg.exe提供以下命令列引數:

/backup 備份登錄檔資料

/restore

顯示備份檔案清單,按照備份時間排序

/comment= 設定備份檔案注釋

/fix 修復登錄檔

/autoscan 自動掃瞄登錄檔

/scanonly 自動掃瞄登錄檔,回報錯誤代號,但不備份。

回報的錯誤代號意義如下:

2 登錄檔資料損毀

0 沒有錯誤

-2 記憶體不足

-3 找不到記憶體登錄檔資料的檔案

-4 無法建立system.dat和user.dat

-5 讀登錄檔資料失敗

-6 寫登錄檔資料失敗

-7 登錄檔資料正在被另外檔案使用

也可以不帶命令列引數直接執行scanreg.exe,完成檢查登錄檔、建立新的登錄檔備份、選取某一備份檔案來恢復登錄檔資料等。筆者就曾經利用這一方法修復登錄檔,使windows98重見天日

在DOS方式下維護登錄檔

在windows95 98視窗環境下維護登錄檔對大多數人來說並不陌生,但是,如果碰上登錄檔損壞,以致連視窗環境都無法進入時,該怎樣對登錄檔進行維護?這裡介紹幾個在dos方式下維護登錄檔的小竅門。登錄檔編輯器一定要在視窗環境下才能執行嗎?不!regedit.exe在dos方式下照常可以執行。在dos方...

DOS下維護登錄檔的高階技巧

現在隨著電腦應用知識的普及,我想,很多朋友對windows登錄檔的修改已經有不少經驗和心得。在圖形介面下對登錄檔的維護和修改,就不必再提了,但有時候,我們可能會遇到更辣手的事情,如由於人為錯誤操作或者惡性病毒感染而使系統切底崩潰,不能進入windows圖形介面時,我們對此是否只有重灌這種方法呢?本文...

在dos下修改登錄檔 2

ms dos方式下也能對登錄檔進行程式設計?是的。當您的windows 95 98因登錄檔問題而無法啟動到圖形介面時,您此時只有在dos下對登錄檔進行手術了。因為登錄檔編輯器regedit.exe其實是乙個雙棲型的程式,既可在dos下執行,也可在windows 95 98下執行。許多使用者可能已經知...