各台机子单独运行?还是服务器分发?
若各机运行是靠什么区分,是IP还是MAC?
若服务器分发是直接分发ini,还是分发bat后各机自动运行?- ::根据IP更改配置文件中ID
- @echo off
- setlocal enableDelayedExpansion
-
- set ip1=192.168.1.20
- set ip2=192.168.1.19
- set ip3=192.168.1.18
- set ip4=192.168.1.17
- set ip5=192.168.1.16
- set ip6=192.168.1.15
- set ip7=192.168.1.14
- set ip8=192.168.1.13
- set ip9=192.168.1.12
- set ip10=192.168.1.11
- set "id1=12863768"
- set "id2=12863767"
- set "id3=12863766"
- set "id4=12863765"
- set "id5=12863764"
- set "id6=12863763"
- set "id7=12863762"
- set "id8=12863761"
- set "id9=12863760"
- set "id10=12863759"
-
- ::识别IP
- call :getIP pcip
- ::set "pcip=192.168.1.18" ::假设
-
- ::更改ID
- for /l %%i in (1,1,10)do (
- if "%pcip%"=="!ip%%i!" (
- sed -i "s/\(COUNTER_NO=\).*$/\1!id%%i!/" "d:\mis.ini"
- goto :outfor
- )
- )
- :outfor
-
- pause
- goto :eof
-
- :getIP gip 获取IP
- 请搜索相应“获取IP”代码
- goto :eof
复制代码
|