올재 이북 공유중(냉무)
2017.02.10 12:00
REGEDIT
Warning: | Before tweaking the registry, make sure you have a full backup of your system. If anything goes wrong, you may end up losing all your data and reinstalling Windows. As Microsoft states it, editing the registry "... is not supported by Microsoft. Use this method at your own risk." |
Read Microsoft's Knowledge Base article Q318149 to learn How to Maintain Current Registry Backups in Windows NT 4.0 and Windows 2000.
General Syntax:
GUI mode: | REGEDIT.EXE | |
Import (merge) a .REG file: | REGEDIT.EXE [ /L:system | /R:user ] [ /S ] importfile.REG | |
Export to a (.REG) file: | REGEDIT.EXE [ /L:system | /R:user ] /E exportfile.REG "registry_key" | |
Compress the registry (Windows 98 only): | REGEDIT.EXE [ /L:system | /R:user ] /C |
Parameters: | ||
importfile.REG | .REG file to be imported (or "merged") | |
exportfile.REG | File name the information should be written to | |
"registry_key" | Registry key to be exported, e.g. "HKEY_CLASSES\ROOT\*\shell" | |
/S | Silent, i.e. hide confirmation box when importing files | |
/E | Export registry file | |
/L:system | Specify the location of the system.dat to use | |
/R:user | Specify the location of the user.dat to use | |
/C | Compress [filename] (Windows 98 only) |
REGEDIT is usually known as a GUI tool to search or edit the Windows registry.
I would not have mentioned it here, however, if it couldn't be used in unattended mode as well.
This page focuses on reading and editing the registry in unattended mode only.
Microsoft's NT 4 Workstation and Server Resource Kits come with REG.EXE, a utility that makes reading (or editing) NT's registry easier.
In Windows 2000, REG.EXE is available on the installation CD-ROM, but has to be installed manually (on the CD-ROM run "\SUPPORT\TOOLS\SETUP.EXE").
As of Windows XP, REG.EXE is a native command.
REG.EXE can read a single key and value directly, without the need for a temporary file.
Learn more about using REG.EXE.
Adding and editing (importing) registry entries
Adding items to the registry requires a *.REG file:
REGEDIT [ /S ] addsome.REG
The /S switch is optional, it skips the message dialogs before and after the import of the *.REG file.
Since NT 4 .REG files are in readable ASCII, they may be created "on the fly" by our batch files.
This is demonstrated in the DefOpen example in the Examples section.
Removing registry entries
To remove an entire "tree" from the registry using REGEDIT and a .REG file, just add a minus sign before the tree name:
REGEDIT4 [-HKEY_CURRENT_USER\DummyTree]
will remove the entire tree "DummyTree".
To remove an individual item from the registry, place the minus sign after the equal sign:
REGEDIT4 [HKEY_CURRENT_USER\DummyTree] "ValueToBeRemoved"=-
will remove the individual value "ValueToBeRemoved" from "DummyTree".
This is demonstrated in the UniqueID.bat example below, a batch file that forces a new LANDesk agent ID.
How to remove an individual registry key or value using *.INF files and RUNDLL is explained by Bill James.
Reading (exporting) from the registry
REGEDIT's /E switch can be used to export a registry key:
REGEDIT /E d:\path\filename.REG "HKEY_XXXX\Whatever Key"
This will write the registry key "HKEY_XXXX\Whatever Key" and its subkeys to a file named d:\path\filename.REG
The resulting (ASCII or UniCode) file will contain the entries in the format "key"="value"
, which can be stripped and parsed using Laurence Soucy's CHOICE trick for MS-DOS 6 and Windows 9*, NT's FOR /F or the more generic TYPE and FIND commands.
Instead of a file name, some device names can be used:
REGEDIT /E PRN "HKEY_XXXX\Whatever Key"
will print the selected key.
Unfortunately, this won't work for CON (console or display).
On most "modern" Windows installations, the PRN device is no longer available, as it requires an LPT or COM port.
Self-contained registry scripts
In .REG files, every line after the first one that starts with a semicolon (;) is treated as comment.
Batch files completely ignore the semicolons before commands.
So the following batch file will use itself as a .REG file:
REGEDIT4 ; @ECHO OFF ; CLS ; REGEDIT.EXE /S "%~f0" ; EXIT [HKEY_CURRENT_USER\Software\Test] "TestVal"="Succeeded"
The REGEDIT4
line is required, and must be the first line, otherwise REGEDIT.EXE
won't accept the script as a valid .REG file.
However, it will generate an error message when running as a batch file, hence the CLS
command to wipe the error message from the screen.
To prevent more error messages, EXIT
is used to abort the batch file immediately after the REGEDIT.EXE
command.
Use this technique to add or remove registry keys and values.
댓글 [8]
-
움이 2017.02.10 13:01
-
노래하는다롱이 2017.02.10 13:18 고맙습니다.
-
크카카 2017.02.10 13:20
감사합니다. 변역이 좋다는 올재군요. 열심히 받아는 놨는데 책볼게 쌓여있어서 언제 다 볼려나..
-
코나 2017.02.10 16:48
헐.. 행복한 고민이시네요..
가난한 이에게 영혼의 양식을 좀 나눔해주세요~
-
모노리스 2017.02.10 17:00
기존에 다운 받으신 이북 공유 부탁드립니다. 꾸벅
-
좋은데이 2017.02.11 08:58
한발 늣었습니다,
도움 주실분 안계십니까?
-
그루터기 2017.02.11 10:02
-
모노리스 2017.02.11 16:46
오 대박...
고맙습니다.
번호 | 제목 | 글쓴이 | 조회 | 등록일 |
---|---|---|---|---|
[공지] | 자유 게시판 이용간 유의사항 (정치, 종교, 시사 게시물 자제) [1] | gooddew | - | - |
29769 | 일반적으로 병원 응급실에 가면 피 검사를 하잔아요? [5] |
|
2208 | 02-12 |
29768 | 오늘의 마지막 신고를 기다리며... [3] |
|
300 | 02-11 |
29767 | 린 - 사랑했잖아 | shy1911 | 341 | 02-11 |
29766 | 나쁜 넘이 나쁜 것을 배우고, 좋은 넘은 나쁜 넘 흉내를 내... [1] |
|
198 | 02-11 |
29765 | ㅇㅇps는 누구의 문제인가? [7] |
|
375 | 02-11 |
29764 | 10만원 신권 ㅋㅋㅋ [21] |
|
3594 | 02-11 |
29763 | .. [1] |
|
537 | 02-11 |
29762 | 이이제이 [3] |
|
520 | 02-11 |
29761 | 정말이지 한국사회는 부정과 비리가 바닥까지 만연한 나라 [11] |
|
763 | 02-10 |
29760 | 신고가 접수된 게시물 - 실험 결과 [7] |
|
482 | 02-10 |
29759 | 입니다님 pe 구할 방법 없나요 ㅠㅠ? [4] | 으아아아아 | 1126 | 02-10 |
29758 | 게시판 글의 권리 [7] |
|
282 | 02-10 |
29757 | 로보폼 8.0 으로 업데이트 되었네요~ [10] | hwasung | 1073 | 02-10 |
» | 올재 이북 공유중(냉무) [8] | 쿵딱쿵 | 945 | 02-10 |
29755 | 서버는 RS2 가 나오지 않을거라고 하네요. [6] | suk | 953 | 02-09 |
29754 | 이름 없는 사회 [6] | Playing | 583 | 02-09 |
29753 | "만덕산이 내려가라 합니다" [4] |
|
675 | 02-09 |
29752 | 인사이터 프리뷰 15025 문제점.. [6] | 로웰 | 873 | 02-09 |
29751 | 운전하는분들 이런 경험이 없나요? [10] | zero2 | 1314 | 02-09 |
29750 | 안면도 꽃게다리 [4] |
|
1099 | 02-09 |
하하 이북 == 북한
옛날엔 이랫는데...