| 	
  
 
UID3569923主题0阅读权限20帖子204精华0积分102金钱323 荣誉0 人气1 在线时间1 小时评议0 
 
 帖子204精华0积分102金钱323 荣誉0 人气1 评议0 
 |  
| 客户机 开机启动 updata3.bat [updata3.bat]
 @call \\dianying2\游戏\更新纪录\updata3.bat
 
 [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
 
 
 :检测
 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
 
 
 
 绑定IP->分配->检测txt文件个数(如果<3进行更新)->更新(先写一个%computername%.txt,更新完再删掉,方便查看哪几个主机在更新)
 | 
 |