[updata3.bat]
@echo off
if exist ipconfig.txt del ipconfig.txt
ipconfig /all >ipconfig.txt
if exist phyaddr.txt del phyaddr.txt
find "Physical Address" ipconfig.txt >phyaddr.txt
if exist ipaddr.txt del ipaddr.txt
find "IP Address" ipconfig.txt >ipaddr.txt
for /f "skip=2 tokens=12" %%M in (phyaddr.txt) do set strMac=%%M
@echo %strMac%
for /f "skip=2 tokens=15" %%I in (ipaddr.txt) do set IPAddress=%%I
@echo %IPAddress%
arp -d >nul
arp -s %IPAddress% %strMac% >nul
ARP -s xxx.xxx.xxx.1 00-3C-01-xx-xx-xx >nul
::绑ip
start/W C:\WINDOWS\system32\worfiv.cpl
::狼牙借口
call \\dianying2\游戏\更新纪录\123\判断.bat
exit
[判断.bat]
for /f "" %%N IN (\\dianying2\useru$\123456\Config.ini) Do if %ComputerName%==%%N (
call \\dianying2\游戏\更新纪录\123\分配.bat
) Else (
echo 123
)
::主要为了看这台机器用不用更新
[分配.bat]
for /f "tokens=*" %%i in (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" goto mbmbpd
@if "%b%"=="0" goto dianying2pd
:mbmbpd
call \\mbmb\游戏\更新纪录\123\判断连接.bat
exit
:dianying2pd
call \\dianying2\游戏\更新纪录\123\判断连接.bat
exit
::为了分配到dianying2 或者mbmb
[连接判断.bat] (2个连接判断是一样的,就是位置不同)
@echo off
set /A x=0
:oo
for /f "tokens=*" %%i in (\\dianying2\useru$\123456\1.ini) do (set /a "str=%%i")
for /f "tokens=*" %%i in (\\dianying2\useru$\123456\2.ini) do (set /a "str1=%%i")
set /A x=x+1
set /A a=%str%
set /A b=%str1%
set /A c=a-b
if %c% GEQ 3 goto pau
if %c% LEQ 3 goto go
:pau
cls
echo.
echo =================================
echo 第 %x% 次等待 连接数目到达最大
echo 8秒钟后尝试再次连接
echo dianying2队列 请稍后...
echo =================================
@echo %ComputerName% 第 %x% 次等待 连接数目到达最大>> \\dianying2\useru$\123456\报告\等待报告.txt
@echo dianying2纪录 %time% , %date% >> \\dianying2\useru$\123456\报告\等待报告.txt
@echo. >> \\dianying2\useru$\123456\报告\等待报告.txt
ping -n 13 localhost > nul
goto oo
:go
for /f "tokens=*" %%i in (\\dianying2\useru$\123456\1.ini) do (set /a "str2=%%i")
set /A a=%str%+1
echo %a% > \\dianying2\useru$\123456\1.ini
call \\dianying2\游戏\更新纪录\123\更新.bat
exit
[更新.bat]
@xcopy /s /z /d /y/e/h \\dianying2\游戏\网络游戏\传奇世界 D:\网络游戏\传奇世界 >nul
...
rd /s/q d:\网络游戏\浩方对战平台
start /w \\dianying2\游戏\浩方\浩方对战平台.exe
for /f "tokens=*" %%i in (\\dianying2\useru$\123456\2.ini) do (set /a "str2=%%i")
set /A a=%str2%+1
echo %a% > \\dianying2\useru$\123456\2.in
Quote:
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