|
本帖最后由 求道者 于 2023-2-5 21:05 编辑
- // 温馨提示:
- // FirPE内的源代码遵循MPL 2.0开源协议,请勿用作商业用途
- // 如需对FirPE进行修改并发布,在发布/宣传页面(包括官方网站)均必须出现显眼的"此作品修改自FirPE"字样并存在FirPE官网的超链接(不得将其故意缩小、添加删除线或放置在二级及以上级菜单/页面内)
- TEAM~ thread*
- \ // 加载默认壁纸
- \ LOGO %WinDir%\web\wallpaper\Windows\img0.jpg ~
- \
- \ // 初始化 WindowsPE
- \ TIPS WinPE初始化,正在初始化,3000,4, ~
- \ TEAM EXEC @=%WinDir%\System32\wpeinit.exe |
- \ INIT CU |
- \ DriveNum ~
- \ FIND $0=%&::bX64%,ENVI ProgramFiles(x86)=%ProgramFiles% ~
- \
- \ // 关闭小键盘(防止不带数字键的笔记本键盘输入错误)
- \ NUMK 0 ~
- \
- \ // 开启数字验证(部分服务需要开启验证)
- \ REGI HKLM\SYSTEM\Setup\SystemSetupInProgress=#0 ~
- \
- \ // 加载网络
- \
- \ serv netprofm ~
- \ serv Wlansvc ~
- \ serv Wcmsvc ~
- \ TEAM EXEC =!netcfg.exe -e -c p -i MS_NDISWAN |
- \ // 开启网络共享服务(有线网卡驱动安装需要)
- \ serv Lanmanserver
- TEAM~ thread*
- \ // 关闭数字验证
- \ REGI HKLM\SYSTEM\Setup\SystemSetupInProgress=#1 ~
- \
- \ // 删除 Desktop.ini
- \ IFEX %Desktop%\desktop.ini,FILE %Desktop%\desktop.ini ~
- \ IFEX X:\Users\Default\Desktop\desktop.ini,FILE X:\Users\Default\Desktop\desktop.ini ~
- \ IFEX X:\Users\Public\Desktop\desktop.ini,FILE X:\Users\Public\Desktop\desktop.ini ~
- \ IFEX X:\Users\Administrator\Desktop\desktop.ini,FILE X:\Users\Administrator\Desktop\desktop.ini ~
- \
- \ // 加载内置软件
- \ TIPS WinPE初始化,正在加载内置软件,2000,4 ~
- \ HOTK CTRL+ALT+A ~
- \ HOTK CTRL+SHIFT+ESC,taskmgr.exe ~
- \ HOTK ALT+D,TEAM TIPS WinPE,正在加载本地所有驱动,2000,4 | EXEC !"%ProgramFiles%\Launcher.cmd" loadLocalDriverOfAll ~
- \ HOTK ALT+N,TEAM TIPS WinPE,正在加载本地网卡驱动,2000,4 | EXEC !"%ProgramFiles%\Launcher.cmd" loadLocalDriverOfNetwork ~
- \
- \ // 加载搜狗输入法
- \ TEAM EXEC =!"%ProgramFiles%\SogouInput\SogouInput.cmd" |
- \ EXEC !ctfmon.exe ~
- \
- \ LOAD "%ProgramFiles(x86)%\main.ini" ~
- \
- \ // 应用系统图标资源包(ess)
- \ TEAM EXEC =!"%ProgramFiles%\Edgeless\theme_processer\setTheme.cmd" autoESS |
- \ // 应用默认主题资源(除了ess,ess在上面被应用)
- \ EXEC !"%ProgramFiles%\Edgeless\theme_processer\setTheme.cmd" auto ~
- \
- \ // 启动桌面
- \ TIPS ~
- \ WALL %WinDir%\web\wallpaper\Windows\img0.jpg ~
- \ REGI HKCU\Software\OpenShell\StartMenu\ShowedStyle2=#1 ~
- \ TEAM EXEC ="%ProgramFiles%\Open-Shell\StartMenu.exe" -xml "%ProgramFiles%\Open-Shell\StartMenu.xml" |
- \ EXEC "%ProgramFiles%\Open-Shell\StartMenu.exe" ~
- \ SHEL %WinDir%\explorer.exe ~
- \ LOGO ~
- \
- \ // 加载WIFI连接程序
- \ EXEC %ProgramFiles%\WinXShell\WinXShell.exe -hidewindow -ui -jcfg wxsUI\UI_WIFI.zip ~
- \
- \ // 设置网络共享密码(WinPE启动后异机可使用 \\本机IP地址\\盘符$ 访问全盘)
- \ EXEC !cmd.exe /c "net user administrator 000000" ~
- \
- \ // 加载文件校验
- \ EXEC !Regsvr32 /s "%WinDir%\System32\HashTab.dll" ~
- \
- \ // 运行IT天空万能驱动及IQIX屏蔽捆绑插件WinPE端
- \ EXEC "%ProgramFiles%\Others\itsk.exe" ~
- \
- \ // 加载ImageView
- \ EXEC !"%ProgramFiles%\Others\ImageView\ImageView.cmd" ~
- \
- \ // 创建硬链接
- \ EXEC !cmd /c "MKLINK "%WinDir%\System32\changepk.exe" "%WinDir%\System32\winver.exe"" ~
- \ EXEC !cmd /c "MKLINK "%WinDir%\System32\XCMD.exe" "%WinDir%\System32\PECMD.exe"" ~
- \ EXEC !cmd /c "MKLINK "%WinDir%\System32\7z.exe" "%ProgramFiles%\7-zip\7z.exe"" ~
- \ EXEC !cmd /c "MKLINK "%WinDir%\System32\7z.dll" "%ProgramFiles%\7-zip\7z.dll"" ~
- \
- \ // 加载开始菜单快捷方式
- \ LINK %Programs%\加载插件,"%ProgramFiles%\Edgeless\plugin_loader\plugin_loader.wcs",,"X:\Program Files\Edgeless\plugin_loader\1.ico" ~
- \ LINK %Programs%\屏幕键盘,"%WinDir%\System32\osk.exe" ~
- \ LINK %Programs%\检测更新,"%WinDir%\About.exe",/UpData ~
- \ LINK %Programs%\理顺盘符,"%ProgramFiles%\Others\AutoSwap.cmd",/S ~
- \ LINK %Programs%\更改主题,"%WinDir%\System32\PECMD.exe",EXEC! %WinDir%\System32\SwitchTheme.cmd,%WinDir%\SystemResources\imageres.dll.mun#32 ~
- \ LINK %Programs%\亮度调整,"%ProgramFiles%\Others\Dimmer\Dimmer.wcs" ~
- \ LINK %Programs%\重载外置,"%ProgramFiles%\Launcher.cmd",loadPETools,"X:\Users\Icon\shortcut\refresh.ico" ~
- \ LINK %Programs%\管理工具\设置虚拟内存,"%ProgramFiles%\Others\VirtualMemory.wcs" ~
- \ LINK %Programs%\管理工具\计算机管理,"%WinDir%\System32\compmgmt.msc" ~
- \ LINK %Programs%\管理工具\设备管理器,"%WinDir%\System32\devmgmt.msc" ~
- \ LINK %Programs%\管理工具\磁盘管理,"%WinDir%\System32\diskmgmt.msc" ~
- \ LINK %Programs%\管理工具\服务,"%WinDir%\System32\services.msc" ~
- \ LINK %Programs%\管理工具\计算器,"%WinDir%\System32\calc.exe" ~
- \ LINK %Programs%\网络工具\网络管理,"%ProgramFiles%\PENetwork\PENetwork.exe" ~
- \ LINK %Programs%\网络工具\宽带拨号,"%WinDir%\System32\rasphone.pbk" ~
- \ LINK %Programs%\网络工具\共享访问设置,"%ProgramFiles%\Others\共享访问设置.cmd"
- // 加载内置驱动
- FORX "%ProgramFiles%\Drives\*.7z",file,0,{
- TEAM NAME fileName=%file% | FDIR fileDir=%file%
- IFEX "%fileDir%\%fileName%.index",EXEC !!DriverIndexer.exe --debug load-driver "%file%" "%fileDir%\%fileName%.index" !EXEC !!DriverIndexer.exe --debug load-driver "%file%"
- }
- // 自动运行网启脚本
- IFEX %WinDir%\System32\PXEAutoRun.cmd,{
- TIPS WinPE初始化,正在运行网启脚本,3000,4,
- EXEC =!%WinDir%\System32\PXEAutoRun.cmd
- }
- // 兼容 Ventoy
- EXEC =!%WinDir%\System32\ventoy.cmd
- TEAM thread*
- \ // 加载外置组件
- \ EXEC !"%ProgramFiles%\Launcher.cmd" loadPETools |
- \
- \ // 显示自定义鼠标样式提示
- \ IFEX X:\Users\RunMSTip,EXEC %WinDir%\System32\0tipMS.wcs |
- \ FILE X:\Users\RunMSTip |
- \
- \ // 加载 Edgeless 插件
- \ EXEC !"%ProgramFiles%\Launcher.cmd" |
- \
- \ // 监视U盘
- \ monitorUDisk
- _SUB READINI
- ENVI^ EnviMode=1
- ENVI &MAX_LENGTH=512 //一般长度不会超过512吧,可以自己设置。
- SET$# &plpReturnedStrings=*%&MAX_LENGTH% 0
- CALL $--qd --bool --ret:&&GetPrivateProfileStringWRet Kernel32.dll,GetPrivateProfileStringW,$%1,$%2,$GetPrivateProfileStringWRet_Failed_PECMD2012,*&&plpReturnedStrings,#%&MAX_LENGTH%,$%3
- SET-make &lpReturnedStrings=&&plpReturnedStrings;(%&&GetPrivateProfileStringWRet%*2)
- ENVI-ret &INI_V=%&lpReturnedStrings%
- _END
- _SUB DriveNum
- FORX \FirPE\FirPE.ini,&INI_P,1,{
- READINI 程序 自动理顺磁盘 %&INI_P%
- IFEX $%&INI_V%=1,{
- TEAM SHOW -check -1:-1 | DISK -check ,,,,?:,0x20
- }
- IFEX $%&INI_V%=2,{
- TEAM SHOW -check *F:0 | DISK -check ,,,4,?:,0x20
- }
- }
- _END
- _SUB monitorUDisk,#
- ENVI @this.MSG=_0x0219::&&wp,&&lp,monitorHandle
- _END
- _SUB monitorHandle
- // 插入U盘
- IFEX #%&wp%=0x8000,
- {*
- PART list disk,&diskCount
- FIND ! $%&diskCount%=,
- {*
- FORX * %&diskCount%,&diskNum,
- {*
- PART list disk %&diskNum%,diskType
- MSTR currentType=<9>%diskType%
- IFEX #%currentType%=7,
- {*
- PART list part %&diskNum%,&partitionNum
- FORX * %&partitionNum%,¤tPartitionNum,
- {*
- PART list part %&diskNum%#%¤tPartitionNum%,&diskInfo
- MSTR Udrive=<8>%&diskInfo%
- IFEX %Udrive%,
- {*
- // 重载外置
- EXEC !"%ProgramFiles%\Launcher.cmd" loadPETools
- }
- }
- }
- }
- }
- }
- // 拔出U盘
- IFEX #%&wp%=0x8004,{*
- }
- _END
复制代码
理顺盘符放在wpeinit.exe和INIT后面正好吧?
我记得这两个都是会给分区分配盘符。
- EXEC =!%WinDir%\System32\ventoy.cmd
复制代码
这个需要等待吗?
|
|