|
先在正常系统中运行MMC提取.bat提取文件,再复制mmcfile文件夹中的文件到PE的\wndows\system32\.
@echo off
rem 提取文件
if not exist mmcfile mkdir mmcfile
cd /d mmcfile
set mmcfile=%cd%
cd /d %windir%\system32\
FOR %%i IN (MMC.EXE MMCBASE.DLL FRGSNAP.DLL DFRGUI.DLL DMDLGS.DLL DMDSKMGR.DLL DMOCX.DLL FILEMGMT.DLL MMCNDMGR.DLL MMCSHEXT.DLL MYCOMPUT.DLL OLEACC.DLL VSSAPI.DLL DMVIEW.OCX devmgr.dll URLMON.DLL DMSERVER.DLL) DO copy /y %%i %mmcfile%\
FOR /F %%i IN ('dir /a /b *.MSC') DO copy /y %%i %mmcfile%\
rem 提取mui
if not exist %mmcfile%\ZH-CN mkdir %mmcfile%\ZH-CN
set mmcmui=%mmcfile%\ZH-CN
cd /D ZH-CN
FOR %%i IN (MMC.EXE MMCBASE.DLL FRGSNAP.DLL DFRGUI.DLL DMDLGS.DLL DMDSKMGR.DLL DMOCX.DLL FILEMGMT.DLL MMCNDMGR.DLL MMCSHEXT.DLL MYCOMPUT.DLL OLEACC.DLL VSSAPI.DLL DMVIEW.OCX devmgr.dll URLMON.DLL DMSERVER.DLL) DO copy /y %%i.mui %mmcmui%\
FOR /f %%i IN ('dir /a /b *.MSC') DO copy /y %%i %mmcmui%
PAUSE
mmc提取.7z
(455 Bytes, 下载次数: 72)
然后在注册MSC文件。
@ECHO OFF
PUSHD %~dp0
SET TP=%CD%
FOR %%i IN (DFRGSNAP.DLL DFRGUI.DLL DMDLGS.DLL DMDSKMGR.DLL DMOCX.DLL FILEMGMT.DLL MMCNDMGR.DLL MMCSHEXT.DLL MYCOMPUT.DLL OLEACC.DLL VSSAPI.DLL DMVIEW.OCX devmgr.dll URLMON.DLL DMSERVER.DLL) DO REGSVR32 /S %%i
REG ADD HKLM\SOFTWARE\Microsoft\Dfrg /v FreeSpaceErrorLevel /t REG_SZ /d 15 /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Dfrg /v PathName /t REG_EXPAND_SZ /d %TP% /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Dfrg /v ResourceDllName /t REG_EXPAND_SZ /d DfrgRes.dll /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Dfrg /v LogFilePath /t REG_EXPAND_SZ /d %%TEMP%%\dfrg.log /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Dfrg /v CreateLogFile /t REG_DWORD /d 1 /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction /v Enable /t REG_SZ /d Y /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction /v LcnEndLocation /t REG_SZ /d 1822133 /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction /v LcnStartLocation /t REG_SZ /d 1713518 /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction /v OptimizeComplete /t REG_SZ /d Yes /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction /v OptimizeError /t REG_SZ /d " 1" /f >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\DefragPath /ve /t REG_EXPAND_SZ /d "%TP%\dfrg.msc %%c:" /f >NUL
REG ADD HKCR\.msc /ve /t REG_SZ /d MSCFile /f >NUL
REG ADD HKCR\MSCFile\DefaultIcon /ve /t REG_EXPAND_SZ /d %%1 /f >NUL
REG ADD HKCR\MSCFile\Shell\Open\Command /ve /t REG_EXPAND_SZ /d "%TP%\MMC.exe \"%%1\" %%*" /f >NUL
exit
MMC.7z
(691 Bytes, 下载次数: 61)
--------------------------------------------------------------------------------------------------------------------------------------------------
1.参考了我心如水PE的添加mmc管理单元代码。
2.可能文件不够,如果不够,请从正常系统的\windows\system32提取。
3.由于是从正常系统的\windows\system32\下提取的,所以PE的位数一定要和被提取的系统一致。
4.在PE下尝试在CMD中键入mmc devmgmt.msc,如果成功打开设备管理器,则添加成功。
|
评分
-
查看全部评分
|