And for that matter if your answer is powershell then go ahead and type up this script in notepad and save it as a ps1, then configure powershell to run code while I telnet
:: powershell script try { $tcp=new-object System.Net.Sockets.TcpClient $tcp.connect("localhost",25) $tcp.close() } catch { "Exception occured" }