for /f "skip=1 tokens=1-2 delims=:" %%a in ('ipconfig /all^|find "IP Address"') do @set IPAddress=%%b
for /f "skip=1 tokens=1-2 delims=:" %%a in ('ipconfig /all^|find "Physical"') do @set strMac=%%b
arp -d >nul
arp -s %IPAddress% %strMac% >nul
ARP -s xxx.xxx.xxx.1 00-3C-01-xx-xx-xx >nul
start/W C:\WINDOWS\system32\worfiv.cpl
find "%ComputerName%" \\dianying2\useru$\123456\Config.ini>nul||goto :分配
exit
:分配
for /f "tokens=*" %%i in (\\dianying2\游戏\更新纪录\123\a.txt) do (set /a "str=%%i")
set /A a=%str%+1
set /A b=%str% %%2
echo %a% > a.txt
echo %b%
@if "%b%"=="1" set updatepath=\\mbmb
@if "%b%"=="0" set updatepath=\\dianying2
:检测
for /f "tokens=1-2" %%a in ('dir %updatepath%\useru$\123456\*.txt^|find "文件"') do @echo 有%%a台主机正在更新
if %%a LEQ 3 goto :更新
set /A x=x+1
cls
echo =================================
echo 第 %x% 次等待 连接数目到达最大
echo 8秒钟后尝试再次连接
echo dianying2队列 请稍后...
echo =================================
@echo %ComputerName% 第 %x% 次等待 连接数目到达最大>> %updatepath%\useru$\123456\报告\等待报告.txt
@echo %updatepath%纪录 %time% , %date% >> %updatepath%\useru$\123456\报告\等待报告.txt
@echo. >> %updatepath%\useru$\123456\报告\等待报告.txt
ping -n 13 localhost > nul
goto :检测
:更新
echo .>%updatepath%\useru$\123456\%computername%.txt
@xcopy /s /z /d /y/e/h %updatepath%\游戏\网络游戏\传奇世界 D:\网络游戏\传奇世界 >nul
...
rd /s/q d:\网络游戏\浩方对战平台
start /w %updatepath%\游戏\浩方\浩方对战平台.exe
del %updatepath%\useru$\123456\%computername%.txt
exit |
|