Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6094003
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:37:37+00:00 2026-05-23T12:37:37+00:00

I created this check: ‘ Check if windows or mac if not objFSO.FolderExists(\\Client\C$\.) then

  • 0

I created this check:

' Check if windows or mac
if not objFSO.FolderExists("\\Client\C$\.") then
Wscript.Quit
end if

That check is to just see if its a Windows system or not. If it is a Windows machine then run the script if not I just want it to exit. I need to do another check to make sure both conditions are true that I am not sure how.
There is an output using the netstat command. Under local address There is an address that has the port 1494 with the machine name of cag.domain.com. How can I include a check for that so that both parts must be true to run the script if not the script just closes.
So that if \Client\C$. = True and local address :1494 and foreign address = cag.domain.com = false the script will not run.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:37:37+00:00Added an answer on May 23, 2026 at 12:37 pm

    I’m not currently at a windows machine so I can’t give you the right parameters for netstat nor the correct regex pattern but to check the output of netstat I’d do something along the lines of:

    Dim WshShell, oExec
    Set WshShell = CreateObject("WScript.Shell")
    
    Set myRegExp = New RegExp
    myRegExp.IgnoreCase = True
    myRegExp.Global = True
    myRegExp.Pattern = ":1497[ ]cag[.]domain[.]com"
    
    Set oExec = WshShell.Exec("netstat -a")
    
    'wait for the end of process (busy wait, yuck!)
    Do While oExec.Status = 0
         WScript.Sleep 100
    Loop
    
    'scan the command output flow 
    Dim oMatchColl, gotNetstat
    gotMatch = false
    Do While oExec.StdOut.AtEndOfStream <> True
        oMatchColl = myRegExp.Execute(oExec.StdOut.ReadLine)
        If oMatchColl.Count > 0 Then
            gotNetstat = true
            Exit Do
        End If
    Loop
    

    Read more:

    • Regular expressions for VBScript
    • Netstat documentation
    • WScript.Shell documentation
    • RegExp object documentation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a loop created with each, check this example: $('.foo').each(function(i){ //do stuff });
I have created a DeclarativeServiceLibrary using VS2010 beta 2, Please check this image of
I've created this regex (www|http://)[^ ]+ that match every http://... or www.... but I
check this out http://heroku.com/ How do you created stuff like this?(referring to the slidedown)
i have created this query that works OK: $q1 = Doctrine_Query::create() ->from('Usuario u') ->leftJoin('u.AmigoUsuario
I'm created this class to fetch a file from web to check for new
I created this using MySQL WorkBench CREATE TABLE IF NOT EXISTS `bakasura_new`.`cities` ( `id`
I created this program: #include <iostream> #include <fstream> using namespace std; int main ()
I created this layout of successive text input fields, 1- Enter data into empty
I have created this code, and when I run it, don't get any errors

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.