• 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.
  • Posts

    • Mastodon updates terms of service to ban AI model training on user data by David Uzondu Mastodon has updated its terms of service to explicitly prohibit scraping its platform to train artificial intelligence models. The new rules, which kick in on July 1, make it perfectly clear that using automated tools to slurp up user data from its main server, Mastodon.social, for LLM training is a big no-no. Neowin received a copy of an email sent to users, notifying them of the change, which introduces new language prohibiting the "scraping of user data for unauthorized purposes, e.g., archival or large language model (LLM) training." Here's a snippet from the updated terms of service: This policy change comes at a time when users are getting increasingly ###### off about their public posts becoming free fuel for the AI gold rush. In fact, this is probably good news for the same crowd over on Bluesky that freaked out after a massive, user-traceable dataset of their public posts was compiled and uploaded for AI research. AI bot scraping has become a huge problem for everyone from giants like Reddit, which is now suing Anthropic, makers of Claude, for training on its posts without a license, to even Neowin readers, like Gerowen, who noted how a swarm of bots, including one Claudebot (you don't say!), hammered his personal server with over 700,000 requests in 24 hours, putting a huge strain on his "home NAS running on an old PC tower in the back woods of Kentucky." It is important to remember that Mastodon is a federated network. These new terms apply specifically to the Mastodon.social server, which is operated directly by Mastodon gGmbH. This means that while users on the main instance are now protected, those on other independent servers in the "fediverse" will only get the same protection if their instance administrators adopt similar terms. The company is globally enforcing a new minimum age requirement of 16 for all users, raising it from the previous limit of 13.
    • Keep in mind that updates for it end on Oct 13, 2026. While this may not matter much for those who don't care about features, it might for fixes, and it certainly would for security.
    • This is why you should have a backup copy of your data on an external drive in addition to the cloud. You never know when one day you could lose access to your cloud
  • Recent Achievements

    • Explorer
      JaviAl went up a rank
      Explorer
    • Reacting Well
      Cole Multipass earned a badge
      Reacting Well
    • Reacting Well
      JLP earned a badge
      Reacting Well
    • Week One Done
      Rhydderch earned a badge
      Week One Done
    • Experienced
      dismuter went up a rank
      Experienced
  • Popular Contributors

    1. 1
      +primortal
      700
    2. 2
      ATLien_0
      275
    3. 3
      Michael Scrip
      219
    4. 4
      +FloatingFatMan
      189
    5. 5
      Steven P.
      146
  • Tell a friend

    Love Neowin? Tell a friend!