无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
楼主: 江南一根葱
打印 上一主题 下一主题

[分享] 从"五秒制作完成网络骨头版pe"瞎改的从原版iso制作网络骨头版pe批处理0422

    [复制链接]
1#
发表于 2021-1-6 21:59:52 | 显示全部楼层
lusir401 发表于 2020-12-25 18:40
发现一个地方有问题:
%~dp0bin\wimlib dir %wimfile% 1 | find ".">1List.TXT
应该加个斜杠变成下面这样 ...

其实%~dp0末尾已是 \ ,不信你 echo %~dp0 看看。不过再加一个 \ 也不影响
回复

使用道具 举报

2#
发表于 2021-2-28 19:17:00 | 显示全部楼层
感谢葱大,基于Win10 1909 18363的BOOT.WIM制作的纯64位PE,任务管理器是英文的,其它界面则正常中文,是否还需要补充什么文件?

点评

这个偶不懂啊,要问发原帖的。。。  详情 回复 发表于 2021-3-1 19:43
回复

使用道具 举报

3#
发表于 2021-3-5 14:53:44 | 显示全部楼层
本帖最后由 lps4290 于 2021-3-5 14:54 编辑

回复错楼层,重新编辑
回复

使用道具 举报

4#
发表于 2021-3-5 14:56:10 | 显示全部楼层
sairen139 发表于 2020-12-14 14:58
这个是新版批处理的内容:

copy Winre.wim BOOT.WIM /y

老大,看过你早前一个帖子,是从卷2导出列表并且对卷2进行wimlib update,卷1无论是一开始删除还是最后删除,都没有用到。

但看了葱哥的批处理,用boot.wim制作,流程是先从卷1导出列表,然后删除卷1,最后按列表进行wimlib精简,即boot.wim卷2按卷1的列表进行精简,虽然最终也制作成功,但卷1和卷2文件列表毕竟不尽相同,@江南一根葱,两位老大觉得有没必要修改一下呢?

我这里修改了,判断是boot.wim后先删除卷1再执行后续,测试通过。顺便简化了一下语句,使得:
1、不用再生成1List.TXT、winsxsList.TXT两个临时列表,减少读写硬盘操作;
2、32位和64位脚本合并为一个,自动判断boot.wim或winre.wim位数。

虽然下面语句临时列表减少到只需要一个List.txt和excel.txt,但其实可以更简化,List.txt也不必生成,直接生成excel.txt,一步到位。以免混乱,下一层楼再发进一步简化版。


@echo off && cd /d %~dp0
if exist winre.wim (
echo 发现winre.wim!准备制作!
set wimfile=winre.wim
goto start
) else (
echo 没有发现winre.wim!尝试从boot.wim制作!
goto checkwim
)

:start
set /a startS=%time:~6,2%
set /a startM=%time:~3,2%
echo %time%
bin\wimlib dir %wimfile% 1 | find "." | findstr /vil "simsun.ttc ping.exe wpeinit.exe SortDefault 3ware.inf halmacpi.dll acpi.inf acpidev.inf acpipagr.inf acpitime.inf adp80xx.inf amdgpio2.inf amdi2c.inf amdsata.inf amdsbs.inf arcsas.inf basicdisplay.inf basicrender.inf battery.inf buttonconverter.inf c_apo.inf c_avc.inf c_battery.inf c_biometric.inf c_cdrom.inf c_computeaccelerator.inf c_computer.inf c_diskdrive.inf c_display.inf c_extension.inf c_firmware.inf c_hdc.inf c_hidclass.inf c_image.inf c_keyboard.inf c_legacydriver.inf c_mcx.inf c_media.inf c_mediumchanger.inf c_memory.inf c_modem.inf c_monitor.inf c_mouse.inf c_mtd.inf c_multifunction.inf c_multiportserial.inf c_net.inf c_netdriver.inf c_netservice.inf c_nettrans.inf c_ports.inf c_processor.inf c_proximity.inf c_sbp2.inf c_scmdisk.inf c_scmvolume.inf c_scsiadapter.inf c_sdhost.inf c_smartcard.inf c_smartcardfilter.inf c_smartcardreader.inf c_smrdisk.inf c_smrvolume.inf c_sslaccel.inf c_swcomponent.inf c_swdevice.inf c_system.inf c_ucm.inf c_unknown.inf c_usb.inf c_usbdevice.inf c_usbfn.inf c_volsnap.inf c_volume.inf c_wceusbs.inf dc21x4vm.inf disk.inf dwup.inf e2xw10x64.inf ehstortcgdrv.inf errata.inf errdev.inf genericusbfn.inf hal.inf halextintclpiodma.inf halextpl080.inf hdaudbus.inf hdaudio.inf hdaudss.inf hidbatt.inf hiddigi.inf hidi2c.inf hidinterrupt.inf hidserv.inf hidspi_km.inf hidvhf.inf hpsamd.inf iagpio.inf iai2c.inf iaLPSS2i_GPIO2_BXT_P.inf iaLPSS2i_GPIO2_CNL.inf iaLPSS2i_GPIO2_GLK.inf iaLPSS2i_GPIO2_SKL.inf iaLPSS2i_I2C_BXT_P.inf iaLPSS2i_I2C_CNL.inf iaLPSS2i_I2C_GLK.inf iaLPSS2i_I2C_SKL.inf ialpssi_gpio.inf ialpssi_i2c.inf iastorav.inf iastorv.inf input.inf ipmidrv.inf ipoib6x.inf iscsi.inf ItSas35i.inf kdnic.inf keyboard.inf lltdio.inf lsi_sas.inf lsi_sas2i.inf lsi_sas3i.inf lsi_sss.inf machine.inf mausbhost.inf mchgr.inf megasas.inf megasas2i.inf megasas35i.inf megasr.inf mf.inf mlx4_bus.inf mshdc.inf msmouse.inf msports.inf mssmbios.inf mtconfig.inf mvumis.inf ndisimplatform.inf ndisimplatformmp.inf ndisuio.inf ndisvirtualbus.inf net1ix64.inf net1yx64.inf net40i68.inf net44amd.inf net7400-x64-n650.inf net7500-x64-n650f.inf net7800-x64-n650f.inf net9500-x64-n650f.inf netax88179_178a.inf netax88772.inf nete1e3e.inf nete1g3e.inf netefe3e.inf netg664.inf netimm.inf netip6.inf netjme.inf netk57a.inf netl160a.inf netl1e64.inf netl260a.inf netloop.inf netmscli.inf netmyk64.inf netnb.inf netnvma.inf netnwifi.inf netrasa.inf netrass.inf netrast.inf netrtl64.inf netserv.inf netsstpa.inf nett4x64.inf nettcpip.inf netvf63a.inf netvg63a.inf netxex64.inf netxix64.inf npsvctrig.inf nvdimm.inf nvraid.inf pci.inf percsas2i.inf percsas3i.inf pmem.inf puwk.inf qd3x64.inf ramdisk.inf rawsilo.inf rdshup.inf rspndr.inf rt640x64.inf rtux64w10.inf sbp2.inf sceregvl.inf scmbus.inf scmvolume.inf scsidev.inf sdbus.inf sdstor.inf secrecs.inf sisraid2.inf sisraid4.inf SmartSAMD.inf smrdisk.inf smrvolume.inf spaceport.inf stexstor.inf stornvme.inf storufs.inf swenum.inf uaspstor.inf uefi.inf ufxchipidea.inf ufxsynopsys.inf umbus.inf umpass.inf unknown.inf usb.inf usbhub3.inf usbnet.inf usbport.inf usbser.inf usbstor.inf usbxhci.inf vdrvroot.inf vhdmp.inf virtdisk.inf volmgr.inf volsnap.inf volume.inf vsmraid.inf vstxraid.inf wdmaudiocoresystem.inf wdmvsc.inf whyperkbd.inf wmiacpi.inf wnetvsc.inf wstorflt.inf wstorvsc.inf wvmbus.inf wvmbushid.inf wvmbusvideo.inf ykinx64.inf L2Schemas aero.msstyles regedit aclui.dll advapi32.dll aepic.dll apisetschema.dll asycfilt.dll atl.dll authz.dll basesrv.dll bcd.dll bcdboot.exe bcdedit.exe bcryptprimitives.dll BFE.DLL BOOTVID.DLL BrokerLib.dll cabinet.dll cdd.dll cfgmgr32.dll ci.dll clb.dll cmd.exe cmdext.dll combase.dll comdlg32.dll coml2.dll conhost.exe console.dll credui.dll cryptbase.dll cryptdll.dll cryptsp.dll bcrypt.dll crypt32.dll cryptsvc.dll msxml ncrypt.dll rasapi32.dll wldp.dll csrsrv.dll csrss.exe C_1252.NLS C_437.NLS C_936.NLS d2d1.dll d3d11.dll dab.dll dabapi.dll dbgcore.dll dbghelp.dll devobj.dll devrtl.dll dhcpcore.dll dhcpcore6.dll dhcpcsvc.dll dhcpcsvc6.dll diskpart.exe dllhost.exe dnsapi.dll dnsrslvr.dll dpapi.dll dpapisrv.dll drvinst.exe drvload.exe drvsetup.dll drvstore.dll dsparse.dll dsrole.dll dui70.dll duser.dll dwmapi.dll DWrite.dll dxgi.dll eappprxy.dll EventAggregation.dll feclient.dll find.exe findstr.exe FirewallAPI.dll fltLib.dll fmifs.dll fontdrvhost.exe format.com fsutil.exe fsutilext.dll fveapi.dll fwbase.dll fwpolicyiomgr.dll FWPUCLNT.DLL gdi32.dll gdi32full.dll gpapi.dll hal.dll hhsetup.dll iertutil.dll ifsutil.dll IKEEXT.DLL imagehlp.dll imageres.dll imapi2.dll imm32.dll ipconfig.exe IPHLPAPI.DLL joinutil.dll KBDUS.DLL kd.dll KerbClientShared.dll kerberos.dll kernel.appcore.dll kernel32.dll KernelBase.dll keyiso.dll ksuser.dll ktmw32.dll l2nacp.dll linkinfo.dll lmhsvc.dll locale.nls logoncli.dll lsasrv.dll lsass.exe lsm.dll l_intl.nls mfc42u.dll mpr.dll MPSSVC.dll msasn1.dll msctf.dll msftedit.dll msimg32.dll msports.dll msprivs.dll msv1_0.dll msvcp110_win.dll msvcp_win.dll msvcrt.dll mswsock.dll ncsi.dll net.exe net1.exe netapi32.dll netbios.dll netcfgx.dll netjoin.dll netlogon.dll netmsg.dll netprovfw.dll NetSetupApi.dll NetSetupEngine.dll NetSetupSvc.dll netshell.dll netutils.dll newdev.dll ninput.dll nlaapi.dll nlasvc.dll normaliz.dll notepad.exe nrpsrv.dll nsi.dll nsisvc.dll ntasn1.dll ntdll.dll ntdsapi.dll ntlanman.dll NtlmShared.dll ntmarta.dll ntoskrnl.exe ole32.dll oleacc.dll oleaccrc.dll oleaut32.dll oledlg.dll OneCoreCommonProxyStub.dll onex.dll osuninst.dll powrprof.dll profapi.dll propsys.dll psapi.dll PSHED.DLL rasadhlp.dll rasman.dll reg.exe regsvr32.exe RpcEpMap.dll rpcrt4.dll RpcRtRemote.dll rpcss.dll rsaenh.dll rundll32.exe samcli.dll samsrv.dll schannel.dll schema.dat sechost.dll secur32.dll services.exe setupapi.dll SHCore.dll shell32.dll shlwapi.dll shutdownux.dll slc.dll SmiEngine.dll smss.exe spfileq.dll spinf.dll sppc.dll srvcli.dll srvsvc.dll sscore.dll sspicli.dll sspisrv.dll stdole2.tlb Storprop.dll svchost.exe sxs.dll sxssrv.dll sysclass.dll sysntfy.dll SystemEventsBrokerServer.dll takeown.exe taskmgr.exe TextShaping.dll ucrtbase.dll uexfat.dll ufat.dll ulib.dll umpdc.dll umpnpmgr.dll umpo.dll unattend.dll untfs.dll urlmon.dll user32.dll userenv.dll usp10.dll UXInit.dll uxtheme.dll vds.exe vdsbas.dll vdsdyn.dll vdsldr.exe vdsutil.dll vdsvd.dll vds_ps.dll version.dll virtdisk.dll webio.dll wevtapi.dll wevtsvc.dll wimgapi.dll wimserv.exe win32k.sys win32kbase.sys win32kfull.sys win32u.dll winbrand.dll Windows.FileExplorer.Common.dll windows.storage.dll CatRoot 2\drivers DriverStore WindowsCodecs.dll winhttp.dll wininet.dll wininit.exe wininitext.dll winlogon.exe winmm.dll winmmbase.dll winnlsres.dll winnsi.dll winpeshl winspool.drv winsrv.dll winsrvext.dll winsta.dll wintrust.dll WinTypes.dll wkscli.dll wkssvc.dll wlanapi.dll wlanhlp.dll wlanmsm.dll wlansec.dll wlansvc.dll wlanutil.dll Wldap32.dll wmiclnt.dll wpeutil ws2_32.dll wshhyperv.dll wsock32.dll wtsapi32.dll xcopy.exe xmllite.dll winload driver.stl winsxs">list.txt
bin\wimlib dir %wimfile% 1 --path=windows\winsxs | find "." | findstr /vi ".*_microsoft.windows.c..-controls.resources_.*_zh-cn .*_microsoft.windows.common-controls .*_microsoft.windows.gdiplus_.*_none Manifests.*_microsoft.windows.i..utomation.proxystub Manifests.*_microsoft.windows.isolationautomation Manifests.*_microsoft.windows.systemcompatible">>list.txt

echo.
echo 正在增删削减%wimfile%包里的文件制作pe过程中,请您稍微等待。。。
if exist excel.txt del excel.txt /f /q
for /f "delims=" %%i in (list.txt) do echo delete --force --recursive "%%i">>excel.txt
bin\wimlib dir %wimfile% 1 --path=Windows\SysWOW64 | find ".dll" >NUL && (set FD=x64) || (set FD=x86)
bin\wimlib update %wimfile%<excel.txt>NUL
bin\wimlib update %wimfile%<%FD%\add2wim.txt>NUL
bin\wimlib optimize %wimfile%

set /a endS=%time:~6,2%
set /a endM=%time:~3,2%
echo %time%
set /a diffS_=%endS%-%startS%
set /a diffM_=%endM%-%startM%
echo cost:%diffM_% %diffS_%
echo.
del /q *.txt
set output=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%wimfile%
ren %wimfile% %output%
echo 感谢您的等待,现在PE已经制作完成,%output%就是你的网络骨头版pe成品!

echo.
PAUSE

:checkwim
if exist boot.wim (
echo 发现boot.wim,直接制作,准备删除卷1……
bin\wimlib delete boot.wim 1 --check
set wimfile=boot.wim
goto:start
)
for /f %%i in ('dir /b %~dp0*.iso') do set iso=%%i
if "%iso%"=="" exit
echo 没有发现boot.wim,正在尝试从iso中解压出boot.wim....
bin\7z.exe e -o%~dp0 -aoa  %~dp0%iso% sources/boot.wim
set wimfile=boot.wim&&goto:start
回复

使用道具 举报

5#
发表于 2021-3-5 14:58:58 | 显示全部楼层
sairen139 发表于 2020-12-14 14:58
这个是新版批处理的内容:

copy Winre.wim BOOT.WIM /y

下面继续简化语句之后就一步生成excel.txt了,不知道两们老大有没测试过这种写法,
可惜虽然减少了临时文件的写入读取,但速度却更慢了,不得不吐槽for命令的低效。
不过我还是喜欢这种简洁的写法,改成这样自用了,慢一些就慢一些吧,也不差这点时间。


@echo off && cd /d %~dp0
if exist winre.wim (
echo 发现winre.wim!准备制作!
set wimfile=winre.wim
goto start
) else (
echo 没有发现winre.wim!尝试从boot.wim制作!
goto checkwim
)

:start
set /a startS=%time:~6,2%
set /a startM=%time:~3,2%
echo %time%
if exist excel.txt del excel.txt /f /q
for /f "delims=" %%i in ('bin\wimlib dir %wimfile% 1 ^| find "." ^| findstr /vil "simsun.ttc ping.exe wpeinit.exe SortDefault 3ware.inf halmacpi.dll acpi.inf acpidev.inf acpipagr.inf acpitime.inf adp80xx.inf amdgpio2.inf amdi2c.inf amdsata.inf amdsbs.inf arcsas.inf basicdisplay.inf basicrender.inf battery.inf buttonconverter.inf c_apo.inf c_avc.inf c_battery.inf c_biometric.inf c_cdrom.inf c_computeaccelerator.inf c_computer.inf c_diskdrive.inf c_display.inf c_extension.inf c_firmware.inf c_hdc.inf c_hidclass.inf c_image.inf c_keyboard.inf c_legacydriver.inf c_mcx.inf c_media.inf c_mediumchanger.inf c_memory.inf c_modem.inf c_monitor.inf c_mouse.inf c_mtd.inf c_multifunction.inf c_multiportserial.inf c_net.inf c_netdriver.inf c_netservice.inf c_nettrans.inf c_ports.inf c_processor.inf c_proximity.inf c_sbp2.inf c_scmdisk.inf c_scmvolume.inf c_scsiadapter.inf c_sdhost.inf c_smartcard.inf c_smartcardfilter.inf c_smartcardreader.inf c_smrdisk.inf c_smrvolume.inf c_sslaccel.inf c_swcomponent.inf c_swdevice.inf c_system.inf c_ucm.inf c_unknown.inf c_usb.inf c_usbdevice.inf c_usbfn.inf c_volsnap.inf c_volume.inf c_wceusbs.inf dc21x4vm.inf disk.inf dwup.inf e2xw10x64.inf ehstortcgdrv.inf errata.inf errdev.inf genericusbfn.inf hal.inf halextintclpiodma.inf halextpl080.inf hdaudbus.inf hdaudio.inf hdaudss.inf hidbatt.inf hiddigi.inf hidi2c.inf hidinterrupt.inf hidserv.inf hidspi_km.inf hidvhf.inf hpsamd.inf iagpio.inf iai2c.inf iaLPSS2i_GPIO2_BXT_P.inf iaLPSS2i_GPIO2_CNL.inf iaLPSS2i_GPIO2_GLK.inf iaLPSS2i_GPIO2_SKL.inf iaLPSS2i_I2C_BXT_P.inf iaLPSS2i_I2C_CNL.inf iaLPSS2i_I2C_GLK.inf iaLPSS2i_I2C_SKL.inf ialpssi_gpio.inf ialpssi_i2c.inf iastorav.inf iastorv.inf input.inf ipmidrv.inf ipoib6x.inf iscsi.inf ItSas35i.inf kdnic.inf keyboard.inf lltdio.inf lsi_sas.inf lsi_sas2i.inf lsi_sas3i.inf lsi_sss.inf machine.inf mausbhost.inf mchgr.inf megasas.inf megasas2i.inf megasas35i.inf megasr.inf mf.inf mlx4_bus.inf mshdc.inf msmouse.inf msports.inf mssmbios.inf mtconfig.inf mvumis.inf ndisimplatform.inf ndisimplatformmp.inf ndisuio.inf ndisvirtualbus.inf net1ix64.inf net1yx64.inf net40i68.inf net44amd.inf net7400-x64-n650.inf net7500-x64-n650f.inf net7800-x64-n650f.inf net9500-x64-n650f.inf netax88179_178a.inf netax88772.inf nete1e3e.inf nete1g3e.inf netefe3e.inf netg664.inf netimm.inf netip6.inf netjme.inf netk57a.inf netl160a.inf netl1e64.inf netl260a.inf netloop.inf netmscli.inf netmyk64.inf netnb.inf netnvma.inf netnwifi.inf netrasa.inf netrass.inf netrast.inf netrtl64.inf netserv.inf netsstpa.inf nett4x64.inf nettcpip.inf netvf63a.inf netvg63a.inf netxex64.inf netxix64.inf npsvctrig.inf nvdimm.inf nvraid.inf pci.inf percsas2i.inf percsas3i.inf pmem.inf puwk.inf qd3x64.inf ramdisk.inf rawsilo.inf rdshup.inf rspndr.inf rt640x64.inf rtux64w10.inf sbp2.inf sceregvl.inf scmbus.inf scmvolume.inf scsidev.inf sdbus.inf sdstor.inf secrecs.inf sisraid2.inf sisraid4.inf SmartSAMD.inf smrdisk.inf smrvolume.inf spaceport.inf stexstor.inf stornvme.inf storufs.inf swenum.inf uaspstor.inf uefi.inf ufxchipidea.inf ufxsynopsys.inf umbus.inf umpass.inf unknown.inf usb.inf usbhub3.inf usbnet.inf usbport.inf usbser.inf usbstor.inf usbxhci.inf vdrvroot.inf vhdmp.inf virtdisk.inf volmgr.inf volsnap.inf volume.inf vsmraid.inf vstxraid.inf wdmaudiocoresystem.inf wdmvsc.inf whyperkbd.inf wmiacpi.inf wnetvsc.inf wstorflt.inf wstorvsc.inf wvmbus.inf wvmbushid.inf wvmbusvideo.inf ykinx64.inf L2Schemas aero.msstyles regedit aclui.dll advapi32.dll aepic.dll apisetschema.dll asycfilt.dll atl.dll authz.dll basesrv.dll bcd.dll bcdboot.exe bcdedit.exe bcryptprimitives.dll BFE.DLL BOOTVID.DLL BrokerLib.dll cabinet.dll cdd.dll cfgmgr32.dll ci.dll clb.dll cmd.exe cmdext.dll combase.dll comdlg32.dll coml2.dll conhost.exe console.dll credui.dll cryptbase.dll cryptdll.dll cryptsp.dll bcrypt.dll crypt32.dll cryptsvc.dll msxml ncrypt.dll rasapi32.dll wldp.dll csrsrv.dll csrss.exe C_1252.NLS C_437.NLS C_936.NLS d2d1.dll d3d11.dll dab.dll dabapi.dll dbgcore.dll dbghelp.dll devobj.dll devrtl.dll dhcpcore.dll dhcpcore6.dll dhcpcsvc.dll dhcpcsvc6.dll diskpart.exe dllhost.exe dnsapi.dll dnsrslvr.dll dpapi.dll dpapisrv.dll drvinst.exe drvload.exe drvsetup.dll drvstore.dll dsparse.dll dsrole.dll dui70.dll duser.dll dwmapi.dll DWrite.dll dxgi.dll eappprxy.dll EventAggregation.dll feclient.dll find.exe findstr.exe FirewallAPI.dll fltLib.dll fmifs.dll fontdrvhost.exe format.com fsutil.exe fsutilext.dll fveapi.dll fwbase.dll fwpolicyiomgr.dll FWPUCLNT.DLL gdi32.dll gdi32full.dll gpapi.dll hal.dll hhsetup.dll iertutil.dll ifsutil.dll IKEEXT.DLL imagehlp.dll imageres.dll imapi2.dll imm32.dll ipconfig.exe IPHLPAPI.DLL joinutil.dll KBDUS.DLL kd.dll KerbClientShared.dll kerberos.dll kernel.appcore.dll kernel32.dll KernelBase.dll keyiso.dll ksuser.dll ktmw32.dll l2nacp.dll linkinfo.dll lmhsvc.dll locale.nls logoncli.dll lsasrv.dll lsass.exe lsm.dll l_intl.nls mfc42u.dll mpr.dll MPSSVC.dll msasn1.dll msctf.dll msftedit.dll msimg32.dll msports.dll msprivs.dll msv1_0.dll msvcp110_win.dll msvcp_win.dll msvcrt.dll mswsock.dll ncsi.dll net.exe net1.exe netapi32.dll netbios.dll netcfgx.dll netjoin.dll netlogon.dll netmsg.dll netprovfw.dll NetSetupApi.dll NetSetupEngine.dll NetSetupSvc.dll netshell.dll netutils.dll newdev.dll ninput.dll nlaapi.dll nlasvc.dll normaliz.dll notepad.exe nrpsrv.dll nsi.dll nsisvc.dll ntasn1.dll ntdll.dll ntdsapi.dll ntlanman.dll NtlmShared.dll ntmarta.dll ntoskrnl.exe ole32.dll oleacc.dll oleaccrc.dll oleaut32.dll oledlg.dll OneCoreCommonProxyStub.dll onex.dll osuninst.dll powrprof.dll profapi.dll propsys.dll psapi.dll PSHED.DLL rasadhlp.dll rasman.dll reg.exe regsvr32.exe RpcEpMap.dll rpcrt4.dll RpcRtRemote.dll rpcss.dll rsaenh.dll rundll32.exe samcli.dll samsrv.dll schannel.dll schema.dat sechost.dll secur32.dll services.exe setupapi.dll SHCore.dll shell32.dll shlwapi.dll shutdownux.dll slc.dll SmiEngine.dll smss.exe spfileq.dll spinf.dll sppc.dll srvcli.dll srvsvc.dll sscore.dll sspicli.dll sspisrv.dll stdole2.tlb Storprop.dll svchost.exe sxs.dll sxssrv.dll sysclass.dll sysntfy.dll SystemEventsBrokerServer.dll takeown.exe taskmgr.exe TextShaping.dll ucrtbase.dll uexfat.dll ufat.dll ulib.dll umpdc.dll umpnpmgr.dll umpo.dll unattend.dll untfs.dll urlmon.dll user32.dll userenv.dll usp10.dll UXInit.dll uxtheme.dll vds.exe vdsbas.dll vdsdyn.dll vdsldr.exe vdsutil.dll vdsvd.dll vds_ps.dll version.dll virtdisk.dll webio.dll wevtapi.dll wevtsvc.dll wimgapi.dll wimserv.exe win32k.sys win32kbase.sys win32kfull.sys win32u.dll winbrand.dll Windows.FileExplorer.Common.dll windows.storage.dll CatRoot 2\drivers DriverStore WindowsCodecs.dll winhttp.dll wininet.dll wininit.exe wininitext.dll winlogon.exe winmm.dll winmmbase.dll winnlsres.dll winnsi.dll winpeshl winspool.drv winsrv.dll winsrvext.dll winsta.dll wintrust.dll WinTypes.dll wkscli.dll wkssvc.dll wlanapi.dll wlanhlp.dll wlanmsm.dll wlansec.dll wlansvc.dll wlanutil.dll Wldap32.dll wmiclnt.dll wpeutil ws2_32.dll wshhyperv.dll wsock32.dll wtsapi32.dll xcopy.exe xmllite.dll winload driver.stl winsxs"') do echo delete --force --recursive "%%i">>excel.txt
for /f "delims=" %%i in ('bin\wimlib dir %wimfile% 1 --path=windows\winsxs ^| find "." ^| findstr /vi ".*_microsoft.windows.c..-controls.resources_.*_zh-cn .*_microsoft.windows.common-controls .*_microsoft.windows.gdiplus_.*_none Manifests.*_microsoft.windows.i..utomation.proxystub Manifests.*_microsoft.windows.isolationautomation Manifests.*_microsoft.windows.systemcompatible"') do echo delete --force --recursive "%%i">>excel.txt

echo.
echo 正在增删削减%wimfile%包里的文件制作pe过程中,请您稍微等待。。。
bin\wimlib dir %wimfile% 1 --path=Windows\SysWOW64 | find ".dll" >NUL && (set FD=x64) || (set FD=x86)
bin\wimlib update %wimfile%<excel.txt>NUL
bin\wimlib update %wimfile%<%FD%\add2wim.txt>NUL
bin\wimlib optimize %wimfile%

set /a endS=%time:~6,2%
set /a endM=%time:~3,2%
echo %time%
set /a diffS_=%endS%-%startS%
set /a diffM_=%endM%-%startM%
echo cost:%diffM_% %diffS_%
echo.
del /q *.txt
set output=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%wimfile%
ren %wimfile% %output%
echo 感谢您的等待,现在PE已经制作完成,%output%就是你的网络骨头版pe成品!

echo.
PAUSE

:checkwim
if exist boot.wim (
echo 发现boot.wim,直接制作,准备删除卷1……
bin\wimlib delete boot.wim 1 --check
set wimfile=boot.wim
goto:start
)
for /f %%i in ('dir /b %~dp0*.iso') do set iso=%%i
if "%iso%"=="" exit
echo 没有发现boot.wim,正在尝试从iso中解压出boot.wim....
bin\7z.exe e -o%~dp0 -aoa  %~dp0%iso% sources/boot.wim
set wimfile=boot.wim&&goto:start

点评

我倒想把for后面的那一堆东西弄到一个txt里,比如win10x86_64.txt ,其它系统就搞个win7x86_64.txt 现在这样看着非常蛋疼,不知道有没有办法实现  详情 回复 发表于 2021-3-5 17:45
如果觉得for慢,可以引进sed.exe,这个第三方的sed.exe可以一次性添加delete —force —recursive这个操作瞬间完成,缩短很多时间。  详情 回复 发表于 2021-3-5 15:44
回复

使用道具 举报

6#
发表于 2021-3-5 18:58:25 | 显示全部楼层
本帖最后由 lps4290 于 2021-3-5 19:18 编辑
江南一根葱 发表于 2021-3-5 17:45
我倒想把for后面的那一堆东西弄到一个txt里,比如win10x86_64.txt ,其它系统就搞个win7x86_64.txt
现在 ...

当然可以。win10x86_64.txt 格式看附件。主要是那两大段换成一个FOR,其余语句不变,耗时几乎不变。下面语句中win10x86_64.txt路径按你实际放置位置改。

win10x86_64.txt (7.05 KB, 下载次数: 11)

:start
set /a startS=%time:~6,2%
set /a startM=%time:~3,2%
echo %time%
for /f "delims=" %%i in (bin\win10x86_64.txt) do (
        echo %%i | find ".exe" >NUL && (
        bin\wimlib dir %wimfile% 1 | find "." | findstr /vil "%%i">>List.txt
        ) || (
        bin\wimlib dir %wimfile% 1 --path=windows\winsxs | find "." | findstr /vi "%%i">>List.txt
        )
)
echo.
echo 正在增删削减%wimfile%包里的文件制作pe过程中,请您稍微等待。。。
if exist excel.txt del excel.txt /f /q
for /f "delims=" %%i in (List.txt) do echo delete --force --recursive "%%i">>excel.txt
bin\wimlib dir %wimfile% 1 --path=Windows\SysWOW64 | find ".exe" >NUL && (set FD=x64) || (set FD=x86)
bin\wimlib update %wimfile%<excel.txt>NUL
bin\wimlib update %wimfile%<%FD%\add2wim.txt>NUL
bin\wimlib optimize %wimfile%







点评

这个好像会跑一大堆的 echo delete --force --recursive " 会比较耗时间,echo off的话貌似会不成功,  详情 回复 发表于 2021-3-5 20:51
用第三方sed.exe来替换掉for语句速度将大大加快,三秒制作完成pe,十几秒制作完成一个精简系统都不成问题!  详情 回复 发表于 2021-3-5 19:12
这样简洁,改一改可以用来精简install.wim制作精简系统了  详情 回复 发表于 2021-3-5 19:06
回复

使用道具 举报

7#
发表于 2021-3-5 19:14:25 | 显示全部楼层
sairen139 发表于 2021-3-5 15:44
如果觉得for慢,可以引进sed.exe,这个第三方的sed.exe可以一次性添加delete —force —recursive这个操 ...

好的,找时间试试。

另外,刚刚在语句列表中发现一个 2\drivers ,应该是手误吧?

点评

不是手误,早期的批处理里查找drivers会连带查找driverstore,所以加了2\,后期的批处理没有这个问题了  详情 回复 发表于 2021-3-5 19:17
回复

使用道具 举报

8#
发表于 2021-3-6 10:09:06 | 显示全部楼层
本帖最后由 lps4290 于 2021-3-7 22:15 编辑
sairen139 发表于 2021-3-5 22:33
用第三方sed.exe跑这个很快,可以省掉for语句的时间

我109楼的语句并不是用FOR直接一步生成excel.txt,所以总耗时并没有明显增加,不用sed.exe问题也不大。
多了一个FOR仅用来读取一次win10x86_64.txt(实际只有两行),取两次值这个FOR就完成任务了,其余
流程差别不大,实测和你最新批处理总耗时几乎没变。


因为准备自用,就把你和葱哥的批处理按自己喜好整理修改了一下,有两个版本,一个总耗时几乎不变,
另一个是用FOR直接一步生成excel.txt,总耗时多3到4秒,可以考虑用sed.exe跑。两位老大有空时也可
以对比测试一下。


Win10x86_64.txt (7.05 KB, 下载次数: 14)


版本一:总耗时几乎不变

@echo off & pushd "%~dp0"
if exist winre.wim (
echo 发现winre.wim!准备制作!
set wimfile=winre.wim & goto :start
)

if exist boot.wim goto :boot_wim

for %%i in (*.iso) do (
echo 没有发现winre.wim和boot.wim,正在尝试从iso中解压出boot.wim ......
bin\7z.exe e -o"%~dp0" -aoa "%%i" sources/boot.wim
if exist boot.wim goto :boot_wim
)
echo. & echo 找不到winre.wim、boot.wim、系统iso任何一个,按任意键退出 ......
pause>nul & EXIT

:boot_wim
echo 发现boot.wim,直接制作,准备删除卷1 ......
bin\wimlib delete boot.wim 1 --check
set wimfile=boot.wim

:start
echo. & echo 开始时间:%time% & set startT=%time%
for /f "delims=" %%i in (bin\Win10x86_64.txt) do (
        echo %%i | find ".exe" >NUL && (
        bin\wimlib dir %wimfile% 1 | find "." | findstr /vil "%%i">>List.txt
        ) || (
        bin\wimlib dir %wimfile% 1 --path=windows\winsxs | find "." | findstr /vi "%%i">>List.txt
        )
)
echo. & echo 正在增删削减%wimfile%包里的文件制作PE过程中,请您稍微等待 ...... & echo.
if exist excel.txt del excel.txt /f /q
for /f "delims=" %%i in (List.txt) do echo delete --force --recursive "%%i">>excel.txt
bin\wimlib dir %wimfile% 1 --path=Windows\SysWOW64 | find ".exe" >NUL && (set FD=x64) || (set FD=x86)
bin\wimlib update %wimfile%<excel.txt>NUL
bin\wimlib update %wimfile%<%FD%\add2wim.txt>NUL
bin\wimlib optimize %wimfile%
set endT=%time%
set /a costM=3%endT:~3,2%-3%startT:~3,2%
if %costM% lss 0 set /a costM=%costM%+60
set /a costT=3%endT:~9,2%-3%startT:~9,2%+(3%endT:~6,2%-3%startT:~6,2%+%costM%*60)*100
echo. & echo 结束时间:%endT%   耗时:%costT:~0,-2%.%costT:~-2% 秒
del /f /q *.txt
set output=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%wimfile%
set output=%output: =0%
ren %wimfile% "%output%"
echo. & echo 感谢您的等待,现在PE已经制作完成,%output%就是你的网络骨头版pe成品! & echo.
pause
EXIT


版本二:直接一步生成excel.txt,优点是生成的临时列表文件最少,缺点是总耗时多3~4秒,CPU占用高些。

@echo off & pushd "%~dp0"
if exist winre.wim (
echo 发现winre.wim!准备制作!
set wimfile=winre.wim & goto :start
)

if exist boot.wim goto :boot_wim

for %%i in (*.iso) do (
echo 没有发现winre.wim和boot.wim,正在尝试从iso中解压出boot.wim ......
bin\7z.exe e -o"%~dp0" -aoa "%%i" sources/boot.wim
if exist boot.wim goto :boot_wim
)
echo. & echo 找不到winre.wim、boot.wim、系统iso任何一个,按任意键退出 ......
pause>nul & EXIT

:boot_wim
echo 发现boot.wim,直接制作,准备删除卷1 ......
bin\wimlib delete boot.wim 1 --check
set wimfile=boot.wim

:start
echo. & echo 开始时间:%time% & set startT=%time%
if exist excel.txt del excel.txt /f /q
for /f "delims=" %%i in (bin\Win10x86_64.txt) do (
        echo %%i | find ".exe" >NUL && (
        for /f "delims=" %%a in ('bin\wimlib dir %wimfile% 1 ^| find "." ^| findstr /vil "%%i"') do echo delete --force --recursive "%%a">>excel.txt
        ) || (
        for /f "delims=" %%a in ('bin\wimlib dir %wimfile% 1 --path=windows\winsxs ^| find "." ^| findstr /vi "%%i"') do echo delete --force --recursive "%%a">>excel.txt
        )
)
echo. & echo 正在增删削减%wimfile%包里的文件制作PE过程中,请您稍微等待 ...... & echo.
bin\wimlib dir %wimfile% 1 --path=Windows\SysWOW64 | find ".exe" >NUL && (set FD=x64) || (set FD=x86)
bin\wimlib update %wimfile%<excel.txt>NUL
bin\wimlib update %wimfile%<%FD%\add2wim.txt>NUL
bin\wimlib optimize %wimfile%
set endT=%time%
set /a costM=3%endT:~3,2%-3%startT:~3,2%
if %costM% lss 0 set /a costM=%costM%+60
set /a costT=3%endT:~9,2%-3%startT:~9,2%+(3%endT:~6,2%-3%startT:~6,2%+%costM%*60)*100
echo. & echo 结束时间:%endT%   耗时:%costT:~0,-2%.%costT:~-2% 秒
del /f /q *.txt
set output=%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%wimfile%
set output=%output: =0%
ren %wimfile% "%output%"
echo. & echo 感谢您的等待,现在PE已经制作完成,%output%就是你的网络骨头版pe成品! & echo.
pause
EXIT






点评

超级棒,感谢你的费心修改!辛苦了!第一个批处理下面这句也可以删掉,改用sed.exe更快:for /f "delims=" %%i in (List.txt) do echo delete --force --recursive "%%i">>excel.txt 其实两个批处理都改用sed.exe  详情 回复 发表于 2021-3-6 10:38
回复

使用道具 举报

9#
发表于 2021-3-6 19:33:45 | 显示全部楼层
sairen139 发表于 2021-3-6 10:38
超级棒,感谢你的费心修改!辛苦了!第一个批处理下面这句也可以删掉,改用sed.exe更快:for /f "delims= ...






没错,就是这个生成excel.txt有for最耗时,无论是用两位老大原来的批处理,还是用我
楼上简化过的,在我这里始终要7秒多,不过估计顶多能再缩减2到3秒,暂时不折腾了,
因为我现在脑壳疼的是,生成的PE只有回收站,而且所有文件无法拖拉,进别人只用
WinXShell接管的PE,拖放则正常,翻S大的帖子,没找到WinXShell的详细用法,
参考别人的代码,尝试了一参数,还是不行,究竟怎样弄呢?

点评

桌面图标拖拽调整位置从 Windows 10.0.10240 之后就不能正常了,之前是可以的。 不过可以把文件拖动到回收站,或者启动应用程序打开,又或者拖动到CMD中,都是可以的。 这个没有参数控制。你说的谁的PE(用Wi  详情 回复 发表于 2021-3-6 20:32
pe只有回收站的问题其实是正常的,如果要加上我的电脑等就要动config里的def那个注册表配置文件了,pe我偏好桌面上图标越少越好,进文件夹我都是点击一下pe任务栏上的资源管理器图标进入。  详情 回复 发表于 2021-3-6 20:26
你如果对winxshell或者pe有什么不明白的,可以直接到slore大神的贴下询问,我以前发帖问slore大神任何事情他都会给我详尽的解答。winxshell的开发者是我在这个论坛遇到的最友善的大神之一!  详情 回复 发表于 2021-3-6 20:22
winxshell的功能太多我也只是用到一点皮毛,winxshell的开发者slore曾经说过关于winxshell的一些东西如下:WinXShell 公开参数一览: wxs-open:system | 打开我的电脑属性 wxs-open:printers | 打开打印机设置窗  详情 回复 发表于 2021-3-6 20:18
回复

使用道具 举报

10#
发表于 2021-3-6 21:14:51 | 显示全部楼层
sairen139 发表于 2021-3-6 20:18
winxshell的功能太多我也只是用到一点皮毛,winxshell的开发者slore曾经说过关于winxshell的一些东西如下 ...

非常感谢分享,我先收藏后面慢慢看
回复

使用道具 举报

11#
发表于 2021-3-6 21:23:04 | 显示全部楼层
slore 发表于 2021-3-6 20:32
桌面图标拖拽调整位置从 Windows 10.0.10240 之后就不能正常了,之前是可以的。
不过可以把文件拖动 ...

不好意思,可能没描述清楚,我是指新生成的PE不能拖放文件进行复制、移动、新建快捷方式等操作,是不是因为缺少系统文件还是哪里设置不对呢?


我用他的PE测试,桌面图标确实不能移动,但文件拖放操作还是可以的。
http://bbs.wuyou.net/forum.php?mod=viewthread&tid=416308

点评

用户主目录没有修改。 WinXShell.exe -winpe启动,会自动设置才对。 你可以启动一个cmd,set USER看下。 把 USERPROFILE应该指向 X:%users\Default 就好了。 默认是 X:\Windows\System32\config\下面,没有  详情 回复 发表于 2021-3-6 21:25
回复

使用道具 举报

12#
发表于 2021-3-6 22:12:32 | 显示全部楼层
本帖最后由 lps4290 于 2021-3-6 22:15 编辑
slore 发表于 2021-3-6 21:25
用户主目录没有修改。

WinXShell.exe -winpe启动,会自动设置才对。




地址栏输入 %userprofile% 会跳转到上图那个路径,打开其中的 Desktop 文件夹,
则会跳转到X:\Users\Default\Desktop

winpeshl.ini 中 WinXShell.exe -winpe 确认无误。进去所有文件夹和文件都像被钉子钉住一样,按住左或右键不放,就是拉不动。

相当奇怪,有点怀疑是我这个winre.wim母包的问题。


点评

进桌面后再次WinXShell -winpe,直接就重启了。 基本确认,要添加原生Explorer支持才行,与WinXShell无关。我测试的那个PE, 虽然没有explorer.exe,但其实已经添加了完整的原生Explorer组件,只是不用 原生exp  详情 回复 发表于 2021-3-7 22:04
你在这个状态下再输入 WinXShell -winpe看看。正常来说,用户目录不该是上面的systemprofile。  发表于 2021-3-6 23:54
回复

使用道具 举报

13#
发表于 2021-3-7 22:04:22 | 显示全部楼层
回复错,已删
回复

使用道具 举报

14#
发表于 2021-3-7 22:05:42 | 显示全部楼层
slore 发表于 2021-3-6 21:25
用户主目录没有修改。

WinXShell.exe -winpe启动,会自动设置才对。

进桌面后再次WinXShell -winpe,直接就重启了。

基本确认,要添加原生Explorer支持才行,与WinXShell无关。我测试的那个PE,
虽然没有explorer.exe,但其实已经添加了完整的原生Explorer组件,只是不用
原生explorer.exe和第3方文件管理器而已。

但是如果要PE体积暴涨才能找回这个功能,想想还是算了。
回复

使用道具 举报

15#
发表于 2021-3-7 22:13:02 | 显示全部楼层
zts59 发表于 2020-12-15 08:41
好用,不错,有一个小错误

那是因为单数小时,比如08点,0会被用空格代替,造成文件名有空格报错。
加上引号就好:"%output%"

又或者在ren前加一行,把空格替换为0 :set output=%output: =0%
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-6-8 15:10

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表