• 0

[VBSCRIPT ]check if TCP port is open


Question

Hi,

I have a problem: I have a script that needs to check if a tcp port is used. if its not used it shall start a program, if the port is used it should do nothing.

The tcp port I want to check is 5555.

I read something about winsock but didnt really get anywhere :s.

I could do it by using the netstat ?command and put the output in a file but thats taking to long as it needs to be done under 300ms (milisecounds).

thx in advance!

Link to comment
https://www.neowin.net/forum/topic/337251-vbscript-check-if-tcp-port-is-open/
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I don't believe plain-old VBscript is capable of network I/O by itself... perhaps you meant VB?

One question though: is the TCP port you are checking local or remote? If it's local, you can simply use Winsock and try to bind to that port--if you can't bind to it, then the port is in use.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.