the tramp Posted June 3, 2009 Report Share Posted June 3, 2009 Люди помогите создать батник!!Задача есть удаленные обьекты,работают на скайлинке,переодически раз в 5ть часов зависают.Хотелось бы батник чтоб пинговал какой нить сервер (например раз в 5ть минут)и при пропадании пинга ребутил комп.Помогите надоело ездить туда!!!!Обьектов много Link to comment Share on other sites More sharing options...
CreatoR Posted June 3, 2009 Report Share Posted June 3, 2009 Примерно так: @Echo OffSet /A WaitTime=60*5Set Address=google.com:LoopPing %Address%If ERRORLEVEL 1 GoTo RebootPing -n %WaitTime% Localhost > NulGoTo Loop:RebootShutdown -rGoTo :EOF :D Link to comment Share on other sites More sharing options...
the tramp Posted June 4, 2009 Author Report Share Posted June 4, 2009 Примерно так: @Echo OffSet /A WaitTime=60*5Set Address=google.com:LoopPing %Address%If ERRORLEVEL 1 GoTo RebootPing -n %WaitTime% Localhost > NulGoTo Loop:RebootShutdown -rGoTo :EOF :blink: [/quote Спасибо будем пробывать Link to comment Share on other sites More sharing options...
the tramp Posted June 4, 2009 Author Report Share Posted June 4, 2009 все работает только нельзя ли время старта после перезагрузки сделать чтобы было не сразу а минут через 10ть,а то инет неуспевает подключиться и все ребутится Link to comment Share on other sites More sharing options...
CreatoR Posted June 4, 2009 Report Share Posted June 4, 2009 сделать чтобы было не сразу а минут через 10ть Ну так в коде же есть строка с ожиданием, примините её там где нужно, указав соответственно время ожидания. Link to comment Share on other sites More sharing options...
the tramp Posted June 8, 2009 Author Report Share Posted June 8, 2009 Ну так в коде же есть строка с ожиданием, примините её там где нужно, указав соответственно время ожидания.к сожелению незнаю как и куда вставить!Покажите! Link to comment Share on other sites More sharing options...
CreatoR Posted June 8, 2009 Report Share Posted June 8, 2009 @Echo OffSet /A ConnectWaitTime=60*10Ping -n %ConnectWaitTime% Localhost > NulSet /A WaitTime=60*5Set Address=google.com:LoopPing %Address%If ERRORLEVEL 1 GoTo RebootPing -n %WaitTime% Localhost > NulGoTo Loop:RebootShutdown -rGoTo :EOF Я так понимаю этот батник запускается с системой (автозапуск)? Т.к в начале, при его запуске, будет пауза в 10 минут. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now