|
slore大神,看了您wimbuilder2-master20190929版本,WimBuilder.cmd里面采用了改变系统变量PROCESSOR_ARCHITECTURE的办法来层层传递变量。
WimBuilder.cmd→WimBuilder_UI.hta→helper_page.js→GetWimInfo.cmd,但是WimBuilder2-slore\wimbuilder2-master20190929\Projects\WIN10XPE\_CustomFiles_\PEMaterial\Autoruns\Startup\NetInit.bat还是用的%PROCESSOR_ARCHITECTURE%来判断操作系统的位数,不知道这个NetInit.bat是由谁来调用的?这里面判定32位64位系统之后,利用drvload加载对应位数的驱动。
- if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
- Drvload.exe athw8x.inf netathr10x.inf netathrx.inf netbc63a.inf netbc64.inf netrtwlane.inf netrtwlane_13.inf netrtwlanu.inf netwbw02.inf netwew00.inf netwew01.inf netwlan92de.inf netwlv64.inf netwns64.inf netwsw00.inf netwtw02.inf netwtw04.inf netwtw06.inf
- ) else (
- Drvload.exe athw8.inf netathr.inf netathr10.inf netbc63.inf netbc64.inf netrtwlane.inf netrtwlane_13.inf netrtwlanu.inf netwbn02.inf netwen00.inf netwen01.inf netwlan92de.inf netwlv32.inf netwns32.inf netwsn00.inf netwtn02.inf netwtn04.inf
- )
复制代码
如果是由32位的cmd调用NetInit.bat一样会出错,因为这是PE重启之后被调用的,不存在变量继承的问题,我觉得还是消除所有的%PROCESSOR_ARCHITECTURE%使用更加可靠。直接用我说的%PROCESSOR_IDENTIFIER:~0,3%==x86来判断更好,因为被调用的子程序单独运行也是可以的,变量传递有时候感觉会失效,比如用nsudo调用的时候,还有在虚拟机里面调用的时候。
- @echo off
- rem 判断64位系统和32位系统
- echo %PROCESSOR_IDENTIFIER%
- if /i %PROCESSOR_IDENTIFIER:~0,3%==x86 (
- echo 32位操作系统
- ) else (
- echo 64位操作系统
- )
- pause
复制代码
|
|