为WinPE添加右键菜单
随着我们对WINPE了解得越来越多,我们已经不满足于仅仅能够使用WINPE,还希望能够对WINPE进行DIY,赋予它更多的功能。今天我们来讲讲如何为WinPE添加右键菜单。一、添加右键看图功能WINPE为了减少体积,一般会把自带的看图软件精简掉。大多数WINPE会用第三方看图程序imagine代替。那我们如何添加imagine并添加右键看图菜单呢?方法如下:1、在WINPE的Program Files放入imagine绿色版。2、在PECMD.INI或其他INI文件添加如下内容:EXEC %ProgramFiles%\Imagine\Imagine64.EXE /assocext /regcontextmenu或者在WINPE的批处理文件中加入如下内容:rem 关联 Imagine%ProgramFiles%\Imagine\Imagine64.exe /assocext /regcontextmenu效果如下:二、右键添加IMDISKImDisk是一款非常小巧方便的虚拟硬盘工具,它可以创建、加载普通镜像文件,也可以将内存中的一部分空间虚拟成硬盘,存放数据以获得高速读取速度。有图形界面及命令行支持。添加方法如下:1、添加文件把IMDISK.SYS放system32下面DRIVERS里面,在system32下面加入imdisk.exe、imdsksvc.exe、IMDISK.CPL三个文件。2、修改注册表修改system32文件夹下config文件夹内的system文件。导入如下内容:注册表一:Windows Registry Editor Version 5.00 "Type"=dword:00000001"Start"=dword:00000002"ErrorControl"=dword:00000000"ImagePath"=hex(2):5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\74,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,52,\00,49,00,56,00,45,00,52,00,53,00,5c,00,69,00,6d,00,64,00,69,00,73,00,6b,00,\2e,00,73,00,79,00,73,00,00,00"DisplayName"="ImDisk Virtual Disk Driver""Description"="Disk emulation driver" 注册表二:Windows Registry Editor Version 5.00 "Type"=dword:00000010"Start"=dword:00000002"ErrorControl"=dword:00000000"ImagePath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,\74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,69,\00,6d,00,64,00,73,00,6b,00,73,00,76,00,63,00,2e,00,65,00,78,00,65,00,00,00"DisplayName"="ImDisk Virtual Disk Driver Helper""ObjectName"="LocalSystem""Description"="Helper service for ImDisk Virtual Disk Driver." PS:修改WINPE注册表的方法,参考我写的《设置WinPE的X盘大小》。3、添加批处理命令:PUSHD %~dp0SET TP=%CD%reg add "HKCR\Drive\shell\ImDiskSaveImage" /f /ve /t REG_SZ /d "保存ImDisk虚拟磁盘"reg add "HKCR\Drive\shell\ImDiskSaveImage\command" /f /ve /t REG_SZ /d "rundll32.exe imdisk.cpl,RunDLL_SaveImageFile %%L"reg add "HKCR\Drive\shell\ImDiskUnmount" /f /ve /t REG_SZ /d "卸载ImDisk虚拟磁盘"reg add "HKCR\Drive\shell\ImDiskUnmount\command" /f /ve /t REG_SZ /d "rundll32.exe imdisk.cpl,RunDLL_RemoveDevice %%L"reg add "HKLM\SOFTWARE\Classes\Ultraiso\shell\ImDiskMountFile" /f /ve /t REG_SZ /d "加载ImDisk虚拟磁盘"reg add "HKLM\SOFTWARE\Classes\Ultraiso\shell\ImDiskMountFile\command" /f /ve /t REG_SZ /d "rundll32.exe imdisk.cpl,RunDLL_MountFile %%L"reg add "HKLM\SOFTWARE\Classes\Winimage\shell\ImDiskMountFile" /f /ve /t REG_SZ /d "加载ImDisk虚拟磁盘"reg add "HKLM\SOFTWARE\Classes\Winimage\shell\ImDiskMountFile\command" /f /ve /t REG_SZ /d "rundll32.exe imdisk.cpl,RunDLL_MountFile %%L" 添加好imdisk右键后,效果如下图:
三、添加右键文件校验右键文件校验有2个办法。第一个办法是用hashtab.dll文件实现。我们把HashTab.dll文件拷贝到system32文件夹下。然后在批处理文件中加入如下内容:rem 关联文件校验regsvr32 /s "%WINDIR%\SYSTEM32\HashTab.dll"reg add "HKU\.DEFAULT\Software\HashTab\Algorithms\CRC32" /f /v "Enabled" /t REG_DWORD /d 1reg add "HKU\.DEFAULT\Software\HashTab\Algorithms\MD5" /f /v "Enabled" /t REG_DWORD /d 1效果如下:第二个方法是用gohash软件实现右键校验功能。GoHash是一个Ghost密码查看和文件Hash校验的工具。才59kb,比HashTab.dll体积要小,功能却更强大。所以现在我们一般用gohash取代了HashTab.dll。添加方法:首先把GoHash放到WINPE中,然后在批处理文件中加入如下内容rem 关联右键文件校验和GHO密码破解reg add "HKLM\SOFTWARE\Classes\*\shell\GoHash\Command" /f /ve /t REG_SZ /d "\"%TP%\tools\GoHash.EXE\" \"%%1\"" PS:%TP%\tools\GoHash.EXE为程序路径。写的时候根据实际路径来。
四、右键MakeCab、ExpandMakeCab、Expand是压缩和解压命令,系统自带的,我们直接添加批处理命令即可:rem 右键MakeCab、Expandreg add "HKLM\SOFTWARE\Classes\*\shell\Makecab" /f /ve /t REG_SZ /d "用Makecab压缩"reg add "HKLM\SOFTWARE\Classes\*\shell\Makecab\command" /f /ve /t REG_SZ /d "makecab.exe /D CompressionType=LZX /D CompressionMemory=21 /D Cabinet=ON /D Compress=ON \"%%1\""reg add "HKLM\SOFTWARE\Classes\*\shell\expand" /f /ve /t REG_SZ /d "用Expand解压"reg add "HKLM\SOFTWARE\Classes\*\shell\expand\command" /f /ve /t REG_SZ /d "expand.exe -r \"%%1\""
五、右键添加重启资源管理器功能批处理添加如下命令:Rem 添加右键“重启资源管理器”菜单reg add "HKLM\Software\Classes\Directory\background\shell\killexplorer" /f /ve /t REG_SZ /d "重启资源管理器(F8)"reg add "HKLM\Software\Classes\Directory\background\shell\killexplorer" /f /v "Icon" /t REG_SZ /d "X:\windows\System32\SHELL32.dll,238"reg add "HKLM\Software\Classes\Directory\background\shell\killexplorer" /f /v "Position" /t REG_SZ /d "Top"reg add "HKLM\Software\Classes\Directory\background\shell\killexplorer\Command" /f /ve /t REG_SZ /d "pecmd KILL EXPLORER.EXE"
六、关联右键显示/隐藏文件和后缀需要WINPE支持VBS。在system32文件夹内加入showfile.vbs文件(参考天意PE),批处理添加如下命令:rem 关联右键显示/隐藏文件和后缀reg add "HKLM\SOFTWARE\Classes\CLSID\{00000000-0000-0000-0000-000000000022}\InProcServer32" /f /ve /t REG_EXPAND_SZ /d "%%SystemRoot%%\system32\shdocvw.dll"reg add "HKLM\SOFTWARE\Classes\CLSID\{00000000-0000-0000-0000-000000000022}\InProcServer32" /f /v "ThreadingModel" /t REG_SZ /d "Apartment"reg add "HKLM\SOFTWARE\Classes\CLSID\{00000000-0000-0000-0000-000000000022}\Instance" /f /v "CLSID" /t REG_SZ /d "{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"reg add "HKLM\SOFTWARE\Classes\CLSID\{00000000-0000-0000-0000-000000000022}\Instance\InitPropertyBag" /f /v "method" /t REG_SZ /d "ShellExecute"reg add "HKLM\SOFTWARE\Classes\CLSID\{00000000-0000-0000-0000-000000000022}\Instance\InitPropertyBag" /f /v "Param1" /t REG_SZ /d "showfile.vbs"reg add "HKLM\SOFTWARE\Classes\CLSID\{00000000-0000-0000-0000-000000000022}\Instance\InitPropertyBag" /f /v "command" /t REG_SZ /d "显示/隐藏文件和后缀"reg add "HKLM\SOFTWARE\Classes\CLSID\{00000000-0000-0000-0000-000000000022}\Instance\InitPropertyBag" /f /v "CLSID" /t REG_SZ /d "{13709620-C279-11CE-A49E-444553540000}"reg add "HKLM\SOFTWARE\Classes\Directory\Background\shellex\ContextMenuHandlers\igfxcui" /f /ve /t REG_SZ /d "{3AB1675A-CCFF-11D2-8B20-00A0C93CB1F4}"reg add "HKLM\SOFTWARE\Classes\Directory\Background\shellex\ContextMenuHandlers\New" /f /ve /t REG_SZ /d "{D969A300-E7FF-11d0-A93B-00A0C90F2719}"reg add "HKLM\SOFTWARE\Classes\Directory\Background\shellex\ContextMenuHandlers\showhide" /f /ve /t REG_SZ /d "{00000000-0000-0000-0000-000000000022}"
七、右键PECMD加载ini批处理添加如下命令:rem 右键PECMD加载inireg add "HKCR\.ini" /ve /d "pecmd" /freg add "HKCR\pecmd" /ve /d "ini配置文件" /fset kjname=打开set kjml=%windir%\system32\NOTEPAD.EXE %%1reg add "HKCR\pecmd\shell" /ve /d "%kjname%" /freg add "HKCR\pecmd\shell\%kjname%\command" /ve /d "%kjml%" /fset kjname=PECMD 加载配置set kjml=%windir%\system32\pecmd.exe load %%1reg add "HKCR\pecmd\shell\%kjname%\command" /ve /d "%kjml%" /f
八、右键添加fastcopyFastcopy是一款速度非常快的文件拷贝软件。可以代替系统自带的拷贝功能。添加方法如下:1、我们首先把fastcopy程序放到WINPE中。2、然后批处理添加如下命令:rem 关联fastcopy右键regsvr32 /s "%TP%\文件工具\Fastext1.dll" PS:%TP%\文件工具\Fastext1.dll为程序路径。写的时候根据实际路径来。右键菜单还有很多,比如右键关联7Z、office等等。通过右键菜单的添加,使得WINPE的功能更强大,使用更方便。期待大家能够发掘更多的右键菜单!
页:
[1]