@ECHO off
del telcc.vbs
del telcc.bat
del ftp1.txt
del ftp1.bat @echo off
setlocal enabledelayedexpansion
(for /f "delims==" %%i in ('dir /b /o:n *.TdlMmBpqRmios') do (
set Rmios=%%i )) @ECHO off
SET /P eNodeBIP="请输入基站IP:"
@ECHO off
SET /P boardNum="请输入BB板数量:"
@ECHO off
setlocal enabledelayedexpansion
for /l %%a in (,,%boardNum%) do (
SET /P boardIP_%%a="请输入BB板槽位:"
) echo open %eNodeBIP%>>ftp1.txt
echo zte>>ftp1.txt
echo Zte_Sdr_Lte_v2>>ftp1.txt
echo cd \mnt>>ftp1.txt
echo ls>>ftp1.txt
echo ha>>ftp1.txt
echo put %Rmios%>>ftp1.txt
echo bye>>ftp1.txt
echo exit>>ftp1.txt @echo off
echo set sh=WScript.CreateObject("WScript.Shell")>>telcc.vbs
echo WScript.Sleep >>telcc.vbs
echo sh.SendKeys "open %eNodeBIP%{ENTER}">>telcc.vbs
echo WScript.Sleep >>telcc.vbs
echo sh.SendKeys "zte{ENTER}">>telcc.vbs
echo WScript.Sleep >>telcc.vbs
echo sh.SendKeys "zte{ENTER}">>telcc.vbs
echo WScript.Sleep >>telcc.vbs
echo sh.SendKeys "./ushell{ENTER}">>telcc.vbs
echo WScript.Sleep >>telcc.vbs
echo sh.SendKeys "zte{ENTER}">>telcc.vbs
echo WScript.Sleep >>telcc.vbs echo sh.SendKeys "pad 1177{ENTER}">>telcc.vbs
echo WScript.Sleep >>telcc.vbs echo sh.SendKeys "UpdateSw ">>telcc.vbs
echo sh.SendKeys Chr()>>telcc.vbs
echo sh.SendKeys "/mnt/%Rmios%">>telcc.vbs
echo sh.SendKeys Chr()>>telcc.vbs
echo WScript.Sleep >>telcc.vbs
echo sh.SendKeys "{ENTER}">>telcc.vbs
echo WScript.Sleep >>telcc.vbs
echo sh.SendKeys "exit{ENTER}">>telcc.vbs echo start telnet.exe>>telcc.bat
echo cscript //nologo telcc.vbs>>telcc.bat @echo off
setlocal enabledelayedexpansion
for /l %%b in (,,%boardNum%) do (
echo sh.SendKeys "telnet 192.254.!boardIP_%%b!.16{ENTER}">>telcc.vbs
echo WScript.Sleep >>telcc.vbs
echo sh.SendKeys "reboot{ENTER}">>telcc.vbs
echo WScript.Sleep >>telcc.vbs
)
echo sh.SendKeys "It's okay^!">>telcc.vbs echo ftp -s:ftp1.txt>>ftp1.bat
echo start telcc.bat>>ftp1.bat start ftp1.bat ::by xxf
1. 脚本本质为模拟键盘输入,所以整个过程中,请勿使用电脑。
2. 当出现“It's okay!”字样时,表示完成。
3. 请将小版本“*.TdlMmBpqRmios”文件放在脚本同一目录下,如果文件扩展名发生变化,请在脚本中修改。
4. 过程中会产生临时文件,使用后可以删除;下次脚本执行的时候,也会自动清理。
5. 脚本的工作流程:ftp上传小版本到\mnt下,在cc板输入升级命令,reboot对应的BB板。
第一次写批处理~