无忧启动论坛

标题: 请教, 注册表挂载HKEY_CURRENT_USER [打印本页]

作者: clautton    时间: 2019-1-10 23:56
标题: 请教, 注册表挂载HKEY_CURRENT_USER
我用.bat将WinPE的注册表挂载到win7:

REG LOAD "HKLM\WinPE-DEFAULT" Default
REG LOAD "HKLM\WinPE-SOFTWARE" Software
REG LOAD "HKLM\WinPE-SYSTEM" System
START /B REGEDIT

例如我要加入WinRAR到HKEY_CURRENT_USER\SOFTWARE:

[HKEY_CURRENT_USER\SOFTWARE\WinRAR\Extraction]
"DefFolder"="C:\\(Test-1)"

WinRAR.reg改成下面导入到.DEFAULT:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\WinPE-.DEFAULT\SOFTWARE\WinRAR\Extraction]
"DefFolder"="C:\\(Test-1)"

导出注册表:

REG UNLOAD "HKLM\WinPE-.DEFAULT"
REG UNLOAD "HKLM\WinPE-SOFTWARE"
REG UNLOAD "HKLM\WinPE-SYSTEM"
attrib -s -h -r *.*

完成之后, 在WinPE内看到WinRAR是在HKEY_USERS\.DEFAULT\Software\WinRAR
HKEY_CURRENT_USER\Software内没有WinRAR.

请问如何才能加到HKEY_CURRENT_USER\Software内的?

谢谢.

作者: qwer-t    时间: 2019-1-11 00:29
说的复杂看不懂。我pe是这样的@ECHO OFF
PUSHD %~dp0

REGEDIT /S "%CD%\WinRAR.REG"
REG ADD HKCR\CLSID\{B41DB860-8EE4-11D2-9906-E49FADC173CA}\InProcServer32 /ve /t REG_SZ /d "%CD%\rarext.dll" /F >NUL
REG DELETE HKCR\.zip\ShellNew /F >NUL
REG ADD HKCR\WinRAR\DefaultIcon /ve /t REG_SZ /d "%CD%\WinRAR.exe,0" /F >NUL
REG ADD HKCR\WinRAR\shell\open\command /ve /t REG_SZ /d "\"%CD%\WinRAR.exe\" \"%%1\"" /F >NUL
REG ADD HKCR\WinRAR.REV\DefaultIcon /ve /t REG_SZ /d "%CD%\WinRAR.exe,1" /F >NUL
REG ADD HKCR\WinRAR.REV\shell\open\command /ve /t REG_SZ /d "\"%CD%\WinRAR.exe\" \"%%1\"" /F >NUL
REG ADD HKCR\WinRAR.ZIP\DefaultIcon /ve /t REG_SZ /d "%CD%\WinRAR.exe,0" /F >NUL
REG ADD HKCR\WinRAR.ZIP\shell\open\command /ve /t REG_SZ /d "\"%CD%\WinRAR.exe\" \"%%1\"" /F >NUL
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe" /ve /t REG_SZ /d "%CD%\WinRAR.exe" /F >NUL
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe" /v Path /t REG_SZ /d "%CD%\WinRAR" /F >NUL
If Not Exist "%SystemRoot%\System32\CABINET.DLL" GOTO END
REG ADD HKCR\.CAB /ve /t REG_SZ /d WinRAR /F>NUL
REG ADD HKCU\Software\WinRAR\Setup\.cab /v Set /t REG_DWORD /d 1 /F>NUL
REG ADD HKCU\Software\WinRAR\Setup\.cab /v Exist /t REG_DWORD /d 1 /F>NUL
REG ADD HKCU\Software\WinRAR\Setup\.cab /v Type /t REG_SZ /d "CLSID\{0CD7A5C0-9F37-11CE-AE65-08002B2E1262}" /F>NUL
REG ADD HKCU\Software\WinRAR\Setup\.cab /v Content /t REG_SZ /F>NUL
REG ADD HKCU\Software\WinRAR\Setup\.cab /v ShellNew /t REG_SZ /F>NUL

rem regsvr32.exe /s "%CD%\RarExt.dll"
reg add "HKLM\SOFTWARE\Classes\*\ShellEx\ContextMenuHandlers\WinRAR" /f /ve /t REG_SZ /d "{B41DB860-64E4-11D2-9906-E49FADC173CA}"
reg add "HKLM\SOFTWARE\Classes\CLSID\{B41DB860-64E4-11D2-9906-E49FADC173CA}" /f /ve /t REG_SZ /d "WinRAR"
reg add "HKLM\SOFTWARE\Classes\CLSID\{B41DB860-64E4-11D2-9906-E49FADC173CA}\InProcServer32" /f /ve /t REG_SZ /d "%CD%\rarext.dll"
reg add "HKLM\SOFTWARE\Classes\CLSID\{B41DB860-64E4-11D2-9906-E49FADC173CA}\InProcServer32" /f /v "ThreadingModel" /t REG_SZ /d "Apartment"
reg add "HKLM\SOFTWARE\Classes\Directory\ShellEx\ContextMenuHandlers\WinRAR" /f /ve /t REG_SZ /d "{B41DB860-64E4-11D2-9906-E49FADC173CA}"
reg add "HKLM\SOFTWARE\Classes\Directory\ShellEx\DragDropHandlers\WinRAR" /f /ve /t REG_SZ /d "{B41DB860-64E4-11D2-9906-E49FADC173CA}"
reg add "HKLM\SOFTWARE\Classes\Drive\shellex\DragDropHandlers\WinRAR" /f /ve /t REG_SZ /d "{B41DB860-64E4-11D2-9906-E49FADC173CA}"
reg add "HKLM\SOFTWARE\Classes\exefile\shellex\PropertySheetHandlers\{B41DB860-64E4-11D2-9906-E49FADC173CA}" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\folder\ShellEx\ContextMenuHandlers\WinRAR" /f /ve /t REG_SZ /d "{B41DB860-64E4-11D2-9906-E49FADC173CA}"
reg add "HKLM\SOFTWARE\Classes\folder\ShellEx\DragDropHandlers\WinRAR" /f /ve /t REG_SZ /d "{B41DB860-64E4-11D2-9906-E49FADC173CA}"
reg add "HKLM\SOFTWARE\Classes\WinRAR" /f /ve /t REG_SZ /d "WinRAR 压缩文件"
reg add "HKLM\SOFTWARE\Classes\WinRAR\DefaultIcon" /f /ve /t REG_SZ /d "%CD%\WinRAR.exe,0"
reg add "HKLM\SOFTWARE\Classes\WinRAR\shell\open\command" /f /ve /t REG_SZ /d "\"%CD%\WinRAR.exe\" \"%%1\""
reg add "HKLM\SOFTWARE\Classes\WinRAR\shellex\ContextMenuHandlers\{B41DB860-64E4-11D2-9906-E49FADC173CA}" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\WinRAR\shellex\DropHandler" /f /ve /t REG_SZ /d "{B41DB860-64E4-11D2-9906-E49FADC173CA}"
reg add "HKLM\SOFTWARE\Classes\WinRAR\shellex\PropertySheetHandlers\{B41DB860-64E4-11D2-9906-E49FADC173CA}" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\WinRAR.REV" /f /ve /t REG_SZ /d "RAR 恢复卷"
reg add "HKLM\SOFTWARE\Classes\WinRAR.REV\DefaultIcon" /f /ve /t REG_SZ /d "%CD%\WinRAR.exe,1"
reg add "HKLM\SOFTWARE\Classes\WinRAR.REV\shell\open\command" /f /ve /t REG_SZ /d "\"%CD%\WinRAR.exe\" \"%%1\""
reg add "HKLM\SOFTWARE\Classes\WinRAR.ZIP" /f /ve /t REG_SZ /d "WinRAR ZIP 压缩文件"
reg add "HKLM\SOFTWARE\Classes\WinRAR.ZIP\DefaultIcon" /f /ve /t REG_SZ /d "%CD%\WinRAR.exe,0"
reg add "HKLM\SOFTWARE\Classes\WinRAR.ZIP\shell\open\command" /f /ve /t REG_SZ /d "\"%CD%\WinRAR.exe\" \"%%1\""
reg add "HKLM\SOFTWARE\Classes\WinRAR.ZIP\shellex\ContextMenuHandlers\{B41DB860-64E4-11D2-9906-E49FADC173CA}" /f /ve /t REG_SZ /d ""
reg add "HKLM\SOFTWARE\Classes\WinRAR.ZIP\shellex\DropHandler" /f /ve /t REG_SZ /d "{B41DB860-64E4-11D2-9906-E49FADC173CA}"
reg add "HKLM\SOFTWARE\Classes\WinRAR.ZIP\shellex\PropertySheetHandlers\{B41DB860-64E4-11D2-9906-E49FADC173CA}" /f /ve /t REG_SZ /d ""

reg add "HKLM\SOFTWARE\WinRAR\Capabilities" /f /v "ApplicationDescription" /t REG_SZ /d "WinRAR"
reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".rar" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".zip" /t REG_SZ /d "WinRAR.ZIP"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".cab" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".arj" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".lzh" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".lha" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".ace" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".7z" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".tar" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".gz" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".tgz" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".uue" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".xxe" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".uu" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".bz2" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".tbz2" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".bz" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".tbz" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".jar" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".iso" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".z" /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\WinRAR\Capabilities\FileAssociations" /f /v ".taz" /t REG_SZ /d "WinRAR"
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe" /f /ve /t REG_SZ /d "%CD%\WinRAR.exe"
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe" /f /v "Path" /t REG_SZ /d "%CD%"

reg add "HKLM\SOFTWARE\Classes\.rar" /f /ve /t REG_SZ /d "WinRAR"
reg add "HKLM\SOFTWARE\Classes\.rar\ShellNew" /f /v "FileName" /t REG_SZ /d "%CD%\rarnew.dat"

rem reg add "HKLM\SOFTWARE\Classes\.zip" /f /ve /t REG_SZ /d "WinRAR.ZIP"
rem reg add "HKLM\SOFTWARE\Classes\.zip\ShellNew" /f /v "FileName" /t REG_SZ /d "%CD%\zipnew.dat"

rem reg add "HKLM\SOFTWARE\Classes\.cab" /f /ve /t REG_SZ /d "WinRAR"
rem rem reg add "HKLM\SOFTWARE\Classes\.7z" /f /ve /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\Classes\.tar" /f /ve /t REG_SZ /d "WinRAR"
rem reg add "HKLM\SOFTWARE\Classes\.Gz" /f /ve /t REG_SZ /d "WinRAR"

reg add "HKLM\SOFTWARE\WinRAR" /f /v "exe64" /t REG_SZ /d "%CD%\WinRAR.exe"
REGEDIT /S "%CD%\WinRAR.REG"
:END
EXIT
作者: qwer-t    时间: 2019-1-11 00:30
上命令

捕获.PNG (4.24 KB, 下载次数: 8)

捕获.PNG

作者: clautton    时间: 2019-1-11 04:57
qwer-t 发表于 2019-1-11 00:30
上命令

在PECMD.INI用这命令之后, 在初始之时, 会弹出cmd窗口, 请问怎样才能不显示这cmd窗口呢?

EXEC =X:\PEsoft\Software.cmd
作者: clautton    时间: 2019-1-11 04:58
qwer-t 发表于 2019-1-11 00:29
说的复杂看不懂。我pe是这样的@ECHO OFF
PUSHD %~dp0

thanks, 请看5楼.
作者: clautton    时间: 2019-1-11 04:58
qwer-t 发表于 2019-1-11 00:29
说的复杂看不懂。我pe是这样的@ECHO OFF
PUSHD %~dp0

thanks, 请看5楼.
作者: clautton    时间: 2019-1-11 04:58
frg521 发表于 2019-1-11 02:22
...

谢谢, 请看5楼.
作者: qwer-t    时间: 2019-1-11 09:09
写入pecmd,启动不显示。
作者: clautton    时间: 2019-1-11 11:12
本帖最后由 clautton 于 2019-1-11 14:09 编辑
frg521 发表于 2019-1-11 05:10
...


只需要这一段All-Software.cmd
我用这不行, 不知哪错了:
EXEC =hide X:\PEsoft\All-Software.cmd

----

//设置分辨率,关闭小键盘,下面'TEXT ********'请勿删除!
TEAM DISP W1600 H1200 B32 F60|NUMK 0
TEXT 初始化 Windows PE 维护系统 #0xFFFFFF L370 T632 R980 B764 $25:Microsoft
EXEC ctfmon.exe

EXEC =hide X:\PEsoft\All-Software.cmd

//对所有分区进行逆序搜索PESOFT.INI并加载外置或内置软件工具
FORX !\PEsoft\PEsoft.ini,MyIni,1,LOAD %MyIni%
EXEC PESET.exe Desktop





欢迎光临 无忧启动论坛 (http://wuyou.net./) Powered by Discuz! X3.3