Edited:
Download nmap command line tools from nmap.org, there you will find ncat.
Copy and paste this text and to text editor and save as .BAT-file
@Echo Off
REM *************************************************************************
REM ** Port tester for Service Uptime Logging using NCAT.EXE from nmap.org **
REM ** **
REM ** Static variables: **
REM ** Host_IP = Hostname or IP you want to test **
REM ** Host_Port = Port number service are listening to **
REM ** LogFileName = Name of Logfile **
REM ** WaitTime = Ca. number of seconds between each query **
REM *************************************************************************
:Pre
SET Host_IP=127.15.4.75
SET Host_Port=80
SET LogFileName=Ncat_%Host_IP%_%Host_Port%.txt
SET WaitTime=10
:Start
ping 127.15.4.75 -w 1000 -n %WaitTime% > NUL
ncat -z %Host_IP% %Host_Port% >NUL
if errorlevel=2 Goto Error2
if errorlevel=1 Goto Error1
if errorlevel=0 Goto Error0
Goto Start
:Error2
Echo %time% Other Error >> %LogFileName%
Goto Start
:Error1
Echo %time% Network Error >> %LogFileName%
Goto Start
:Error0
Echo %time% Connection successful >> %LogFileName%
Goto Start
:End