- del 1.txt
- for /f "tokens=1,2,3,4,5,6 delims=:" %%i in ('wmic nic where "netconnectionid='本地连接 2'" get macaddress') do set q=%%i-%%j-%%k-%%l-%%m-%%n
- set /s aa=%q%
- pause
- for /f "delims=" %%a in (ptc_licfile.dat) do (
- set str=%%a
- setlocal enabledelayedexpansion
- set "str=!str:00-23-8B-BF-5F-E8=%aa%!"
- echo,!str:*:=!
- endlocal
- )>>1.txt
复制代码 ptc_licfile.dat 内容:
INCREMENT MECBASICUI_12345 ptc_d 29.0 permanent uncounted \
VENDOR_STRING="VSVER=2.0 LO=(19,157,211)" SUPERSEDE HOSTID=PTC_HOSTID=00-23-8B-BF-5F-E8 \
vendor_info="VIVER=2.0 EXTERNAL_NAME=" ISSUER=ODT \
ISSUED=2-apr-2006 NOTICE=PTC SN=07071982 SIGN="092F DBD8 F7BA \
EC9D 51E5 453C 93A1 D63D 0BC7 3126 8493 2C23 32A9 A98F 8BC0 1BEB \
0F0F 5C63 6933 5B61 613F 0CFB 235B 9C1B B39E 274F 2E5A 60E1 1FEF \
DE6A" SIGN2="092F DBD8 F7BA EC9D 51E5 453C 93A1 D63D 0BC7 3126 \
8493 2C23 32A9 A98F 8BC0 1BEB 0F0F 5C63 6933 5B61 613F 0CFB 235B \
9C1B B39E 274F 2E5A 60E1 1FEF DE6A"
为什么替换了就没了? |