0

I want to test quickly if a PC or a web-server is up and running using telnet on port 80. I've been around for 1 hour until now and came up with the above script that still doesn't work. Is anyone experienced in batch programming to help me? the execution stop after telnet because once getting on telnet it doesn't enter the 2 other commands, + I think that the telnet need 2 sequential press enter key to run that still i don't know how to do it

:abc
@echo off
echo =================================================
SET /P txt=domainin:
SET /P var=Porten:
telnet %txt% %var%
echo GET / HTTP/1.1 
echo HOST: %txt%
pause
GOTO:abc
emirjonb
  • 203
  • 2
  • 12
  • 1
    telnet doesn't read stdin so this can't be done this way. Use wget or curl instead. – rene Mar 18 '15 at 09:43
  • I appreciate but i am on windows – emirjonb Mar 18 '15 at 09:56
  • So? Curl has a windows build as does wget if I'm not mistaken. – rene Mar 18 '15 at 09:59
  • As i sad earlier I just need a simple tool to run as quickly as possible, I can still type the command manually and get the result. I want to stay on "native" windows – emirjonb Mar 18 '15 at 10:05
  • I will try if I can get something with VB scripts – emirjonb Mar 18 '15 at 10:07
  • OK, I understand. That restriction is not explicit in your question hence my suggestion. – rene Mar 18 '15 at 10:07
  • Can you use Powershell? For vbscript check [this](http://stackoverflow.com/a/91488/578411) – rene Mar 18 '15 at 10:08
  • Also, [hybrid batch + JScript web service checker](http://stackoverflow.com/q/15395490/1683264) using the `Microsoft.XMLHTTP` COM object. (See the question, rather than the answer, for the solution to your problem.) – rojo Mar 18 '15 at 20:31

0 Answers0