Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Unanswered: Result of a Shell-command

    Hello,

    I was thinking of writing a small application to check if our wireless accesspoints are stil online.

    Therefore I used
    Shell ("ping.exe xxx.xxxx.xxx.xxx)
    where xxx.xxxx.xxx.xxx is an IP-address

    When executing this from the DOS-prompt, it shows wether there is a respons or not.

    Is there any possibility to get the result of this command in my VBA-code?

    Thanks

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    how about using the pipe command to send the output to a file, and then reading that file back? I always knew my pre windows knowledge would come in handy....

    Shell ("ping.exe xxx.xxxx.xxx.xxx > myfilespec")

    the only real problem I can see is that...
    ping takes some time to run, so you would need to add a delay between issuing the command and reading the file
    You would need to check the file timestamp to make sure that the file you are reading is the correct one, and not an artifact from previous calls oto thsi procedure

    Im sure there must be a better way to do this.. isn't there an IP socket widget that will do that for you?

  3. #3
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    Yes there is

    Greetz Marvels -^.^-
    Developments : VB4 Through .Net; Basic; DOS ; CNC ; Sinclair
    Databases : SQL Server Through 2005; Access 3 Through 2003 ; Oracle 8 & 9.i ;
    OS : Win 3.11 Through XP ; NortonComander ; DOS

  4. #4
    Join Date
    Feb 2005
    Posts
    46
    This is one that I can actually reply to (almost) as I've created this kind of thing before.

    Create a bat file that pings the router but redirect the output to a txt file

    What needs to happen (command button on click??)
    Access runs the bat file and then inputs the result of that file to a string variable.

    Now with text file content loaded in to the string variable you are able to manipulate it with left right trim & all the other string features to determine if the ping replied or not replied.

    I'm at work at the moment but if your struggling reply back and I will post the code I used when I get home.

  5. #5
    Join Date
    Feb 2007
    Posts
    15
    Hello there,

    Try to use winsock activeX control.

    I think it would manage what you want.

    OS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •