求一批处理,关于PING命令
想实现的批处理是:ping192.168.1.2这个IP,如果IP是通的,则执行\\192.168.1.2\a.bat否则显示:服务器尚未启动,请联系管理员!...
想实现的批处理是: ping 192.168.1.2 这个IP,如果IP是通的,则执行\\192.168.1.2\a.bat 否则显示:服务器尚未启动,请联系管理员!
展开
2个回答
展开全部
cls
@echo off
goto 1
:2
mshta vbscript:msgbox("从备用服务器获取地址")(window.close)
echo Set xPost = createObject("Microsoft.XMLHTTP") >get.vbs
echo xPost.Open "GET","",0 >>get.vbs
echo xPost.Send() >>get.vbs
echo Set sGet = createObject("ADODB.Stream") >>get.vbs
echo sGet.Mode = 3 >>get.vbs
echo sGet.Type = 1 >>get.vbs
echo sGet.Open() >>get.vbs
echo sGet.Write(xPost.responseBody) >>get.vbs
echo sGet.SaveToFile "ftp.txt",2 >>get.vbs
get.vbs
del get.vbs /q
:1
echo open >temp.bat
type ftp.txt >>temp.bat
echo. >> temp.bat
echo anonymous >>temp.bat
echo 123456 >>temp.bat
echo Cd data >>temp.bat
echo Bin >>temp.bat
echo Prompt >>temp.bat
echo Mget *.* >>temp.bat
echo Bye >>temp.bat
echo Quit >>temp.bat
echo Exit >>temp.bat
ftp -s:temp.bat
del temp.bat /q
@echo off
goto 1
:2
mshta vbscript:msgbox("从备用服务器获取地址")(window.close)
echo Set xPost = createObject("Microsoft.XMLHTTP") >get.vbs
echo xPost.Open "GET","",0 >>get.vbs
echo xPost.Send() >>get.vbs
echo Set sGet = createObject("ADODB.Stream") >>get.vbs
echo sGet.Mode = 3 >>get.vbs
echo sGet.Type = 1 >>get.vbs
echo sGet.Open() >>get.vbs
echo sGet.Write(xPost.responseBody) >>get.vbs
echo sGet.SaveToFile "ftp.txt",2 >>get.vbs
get.vbs
del get.vbs /q
:1
echo open >temp.bat
type ftp.txt >>temp.bat
echo. >> temp.bat
echo anonymous >>temp.bat
echo 123456 >>temp.bat
echo Cd data >>temp.bat
echo Bin >>temp.bat
echo Prompt >>temp.bat
echo Mget *.* >>temp.bat
echo Bye >>temp.bat
echo Quit >>temp.bat
echo Exit >>temp.bat
ftp -s:temp.bat
del temp.bat /q
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询