|
本帖最后由 nttwqz 于 2022-5-8 21:44 编辑
画蛇添足了。。。
- if %verbuild% EQU 17763 goto 1776X
- if %verbuild% EQU 18362 goto 1836X
- if %verbuild% EQU 18363 goto 1836X
- if %verbuild% EQU 19042 goto 1904X
- if %verbuild% EQU 19043 goto 1904X
- if %verbuild% EQU 19044 goto 1904X
- if %verbuild% EQU 22000 goto 2200X
- :1776X
- set BB=1776X
- ::启用NetFx3
- if exist "%~d0\.NTE\%BB%\*.*" dism /online /enable-feature /featurename:netfx3 /source:"%~d0\.NTE\%BB%"
- exit
- :1836X
- set BB=1836X
- ::启用NetFx3
- if exist "%~d0\.NTE\%BB%\*.*" dism /online /enable-feature /featurename:netfx3 /source:"%~d0\.NTE\%BB%"
- exit
- :1904X
- set BB=1904X
- ::启用NetFx3
- if exist "%~d0\.NTE\%BB%\*.*" dism /online /enable-feature /featurename:netfx3 /source:"%~d0\.NTE\%BB%"
- exit
- :2200X
- set BB=2200X
- ::启用NetFx3
- if exist "%~d0\.NTE\%BB%\*.*" dism /online /enable-feature /featurename:netfx3 /source:"%~d0\.NTE\%BB%"
- exit
复制代码
改成
- for %%a in (17763 18362 18363 19042 19043 19044 22000) do if %verbuild% equ %%a set bb=%verbuild:~0,-1%X
- ::启用NetFx3
- if exist "%~d0\.NET\%BB%\*.*" dism /online /enable-feature /featurename:netfx3 /source:"%~d0\.NET\%BB%"
- exit
复制代码
如果你能确认除了最后一位前面版本相同能通用的话(我记得10 19044 和11的22000一样)
- set bb=%verbuild:~0,-1%X
- ::启用NetFx3
- if exist "%~d0\.NET\%BB%\*.*" dism /online /enable-feature /featurename:netfx3 /source:"%~d0\.NET\%BB%"
- exit
复制代码
另外,通过set定义的变量不分大小写,所以BB=bb |
|