![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-09-24 06:47 |
47,812 topics / 349,917 posts / today 0 new / 48,274 members |
| DOS批处理 & 脚本技术(批处理室) » Help: How to convert a registry file into a batch file |
| Printable Version 5,837 / 31 |
| Floor16 hxuan999 | Posted 2006-11-23 00:58 |
| 中级用户 Posts 161 Credits 337 | |
| Floor17 a9319751 | Posted 2006-11-28 05:54 |
| 中级用户 Posts 170 Credits 439 | |
Originally posted by fastslz at 2006-11-9 09:43: |
|
| Floor18 ccwan | Posted 2006-11-28 06:14 |
| 金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊 | |
Originally posted by a9319751 at 2006-11-28 05:54: This is to use batch processing to generate a registry file "tmp.reg", import it into the registry, and finally delete this registry file. |
|
| Floor19 q8q8feng | Posted 2006-11-29 04:09 |
| 初级用户 Posts 28 Credits 56 | |
Originally posted by eech at 2006-11-9 10:58 AM: Support it |
|
| Floor20 edward | Posted 2006-12-10 07:56 |
| 新手上路 Posts 1 Credits 2 | |
| Floor21 fastrun | Posted 2006-12-14 02:24 |
| 初级用户 Posts 24 Credits 46 | |
Originally posted by electronixtar at 2006-11-8 09:42 PM: Support one |
|
| Floor22 无奈何 | Posted 2006-12-14 03:55 |
| 荣誉版主 Posts 356 Credits 1,338 | |
Originally posted by electronixtar at 2006-11-9 10:42: I thought about using gawk to write one before, but found it too complicated. I spent some time on it but made no progress. Everyone can do more research in this area. There are so many things that can be done with registry operations. |
|
| Floor23 HUNRYBECKY | Posted 2006-12-14 05:10 |
| 银牌会员 Posts 442 Credits 1,179 | |
Originally posted by electronixtar at 2006-11-9 10:42: This suggestion is very good and very practical. However, what is the difficulty level? |
|
| Floor24 HUNRYBECKY | Posted 2006-12-14 05:19 |
| 银牌会员 Posts 442 Credits 1,179 | |
|
There are many ways to write the registry. I usually use the methods of echo>> and the REG command.
The following is a segment of code I wrote for operating the registry when creating the green version of ACCESS 2003. REM Set registry 1. Set the application path so that the program can be executed in the command line. Here, the method of importing and generating and importing the registry is used ECHO REGEDIT4 >>APPPaths.REG ECHO. >>APPPaths.REG ECHO [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\MSACCESS.EXE] >>APPPaths.REG ECHO @="%CPATH%\\MSACCESS.EXE" >>APPPaths.REG ECHO "Path"="%CPATH%\\" >>APPPaths.REG ECHO "useURL"="1" >>APPPaths.REG regedit /s APPPaths.REG >NULL del APPPaths.REG /q/f >NULL cls REM Set registry 2. Set the product registration authorization information of the application, otherwise the software cannot be used. Here, the REG method is used REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Licenses\73A4C9C1-D68D-11d0-98BF-00A0C90DC8D9\11.0\Retail" /F REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Licenses\73A4C9C1-D68D-11d0-98BF-00A0C90DC8D9\11.0\Retail" /ve /t REG_SZ /d sbbcdcprktpjtapmmfdacmupasbhscddncgp /f cls REM Set registry 3. Set the VBA path, otherwise the VBE editing program cannot be used for secondary development. Here, the REG method is still used. Note that when using variables, use "" to enclose them. The help says to use %% which is incorrect REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VBA" /F REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VBA" /v "Vbe6DllPath" /t REG_SZ /d "%CommonProgramFiles%"\MICROS~1\VBA\VBA6\VBE6.DLL /f cls REM Set registry 4. Set the software registry information, generally the registry item under the software name binsub office.REG E:\\OFFICE2003\\OFFICE11\\ %CPATH%\\ >NULL binsub office.REG C:\\ %SystemDrive%\\ >NULL regedit /s office.REG >NULL del office.REG /q/f >NULL CHCP 936 >NULL cls REM Set registry 5. Set file association. Here, it can also be implemented using FOR. Note that version 1.8 of BINSUB supports at most 127 characters. The problem has been solved in version 2.1. binsub link.reg E:\\OFFICE2003\\OFFICE11\\ %CPATH%\\ >NULL binsub link.reg C:\\ %SystemDrive%\\ >NULL regedit /s link.reg >NULL del link.reg /q/f >NULL CHCP 936 >NULL cls REM Set registry 6. Create the language setting add-in Language.mda. After setting, the ACCESS interface language can also be set through the language setting add-in REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Access\Menu Add-Ins\&Language Setting" /F REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Access\Menu Add-Ins\&Language Setting" /v "Expression" /t REG_SZ /d "=LangSet()" /f REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\11.0\Access\Menu Add-Ins\&Language Setting" /v "Library" /t REG_SZ /d "Language.mda" /f REM Set registry 7. Add the built-in controls and enhanced controls for advanced development. REM Removed OWC11.DLL MSRTEDIT.DLL, REFEDIT.DLL and other controls. They can be added when needed REM First register the SNAPVIEW.OCX snapshot file, which has been extracted in profile.exe first. regsvr32 /s "%CommonProgramFiles%\Micros~1\Snapsh~1\SNAPVIEW.OCX" REM Register built-in controls and enhanced controls plugin.exe REM Barcode control copy plugin\MSBCODE9.OCX ..\ /Y >NULL regsvr32 /s ..\MSBCODE9.OCX REM Calendar control MSCAL.OCX, where Mscomct2.ocx is a better calendar control copy plugin\MSCAL.OCX ..\ /Y >NULL regsvr32 /s ..\MSCAL.OCX copy plugin\Mscomct2.ocx ..\ /Y >NULL regsvr32 /s ..\Mscomct2.ocx REM form2.0 control copy plugin\FM20.DLL %WINDIR%\SYSTEM32\ /y >NULL regsvr32 /s %WINDIR%\SYSTEM32\FM20.DLL REM VSFLEX3.0 control copy plugin\VSFLEX3.OCX %WINDIR%\SYSTEM32\ /y >NULL regsvr32 /s %WINDIR%\SYSTEM32\VSFLEX3.OCX REM Public component latest control 6.0: mscomctl.ocx (the 5.0 one is comctl32.ocx, not used here), need authorized registration copy plugin\mscomctl.ocx %WINDIR%\SYSTEM32\ /y >NULL regsvr32 /s %WINDIR%\SYSTEM32\mscomctl.ocx REM Public dialog latest control 6.0: COMDLG32.OCX, need authorized registration copy plugin\COMDLG32.OCX %WINDIR%\SYSTEM32\ /y >NULL REM Serial port programming latest control 6.0: Mscomm32.ocx, need authorized registration copy plugin\Mscomm32.ocx %WINDIR%\SYSTEM32\ /y >NULL regsvr32 /s %WINDIR%\SYSTEM32\Mscomm32.ocx REM Text editing latest control 6.0: RICHTX32.OCX, need authorized registration copy plugin\RICHTX32.OCX %WINDIR%\SYSTEM32\ /y >NULL regsvr32 /s %WINDIR%\SYSTEM32\RICHTX32.OCX REM Table latest control 6.0: MSFLXGRD.OCX, need authorized registration copy plugin\MSFLXGRD.OCX %WINDIR%\SYSTEM32\ /y >NULL regsvr32 /s %WINDIR%\SYSTEM32\MSFLXGRD.OCX REM Network latest control 6.0: Mswinsck.ocx, need authorized registration >NULL copy plugin\Mswinsck.ocx %WINDIR%\SYSTEM32\ /y regsvr32 /s %WINDIR%\SYSTEM32\Mswinsck.ocx regedit /s PLUGINS.REG >NULL del PLUGINS.REG /q/f >NULL RD plugin /Q/S >NULL CLS REM Create the shortcut of the program running: desktop, quick launch bar, program menu. Here, the LEELINK tool is used. Before creating, the CPATH environment variable needs to be changed (can be implemented using COPY method) CALL CPTEMP.bat SLINK /F:%CPATH%\MSACCESS.EXE /C:Microsoft Office Access 2003 /s:y /d:y del slink.exe /q/f >NULL rem ================================================================ rem cd .. rem copy Micros~1.lnk "%ALLUSERSPROFILE%\桌面\ /Y" rem copy Micros~1.lnk %ALLUSERSPROFILE%\桌面\「开始」菜单\ /Y rem copy Micros~1.lnk %ALLUSERSPROFILE%\桌面\「开始」菜单\程序 /Y rem cd STARTUP\ rem ================================================================ cls |
|
| Floor25 kich | Posted 2006-12-16 00:14 |
| 中级用户 Posts 168 Credits 397 | |
|
Wow, that's really strong! It's like a blind person reading a post!!
|
|
| Floor26 swlove | Posted 2006-12-16 07:01 |
| 初级用户 Posts 28 Credits 84 | |
Originally posted by kich at 2006-12-16 00:15: The same feeling... |
|
| Floor27 qpmgljf | Posted 2007-01-07 05:51 |
| 初级用户 Posts 49 Credits 125 | |
|
Wow, impressive... But it makes my eyes dizzy... Can the person on floor 26 directly create a conversion program?
|
|
| Floor28 bingxiao20 | Posted 2007-04-30 02:40 |
| 初级用户 Posts 31 Credits 68 | |
Originally posted by fastslz at 2006-11-8 08:43 PM: |
|
| Floor29 hdzc | Posted 2007-10-27 20:55 |
| 初级用户 Posts 86 Credits 146 | |
| Floor30 lzys | Posted 2007-10-28 01:55 |
| 初级用户 Posts 28 Credits 54 | |
|
The suggestion from the friend on the 5th floor, I strongly support... Hehe... It saves a lot of trouble... Haha
|
|
| Prev 1 2 3 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |