Your forum username:
Do you already have an account?
Forgot your password?
  • Log in or Sign up


    Welcome to Sky User - The Unofficial Support Forum for everything Sky! - Proudly helping over 65k members.


    Advertisement

    Page 2 of 2 FirstFirst 12
    Results 11 to 14 of 14
    Like Tree1Likes

    Hi i need help writing a vbs or batch file to ping an ip address

    This is a discussion on Hi i need help writing a vbs or batch file to ping an ip address within the General Computing and Internet forums, part of the Community channel category; Try echo %date% %time% >> c:\users\yourname\desktop\ping.txt ping 192.168.n.n >> c:\users\yourname\desktop\ping.txt...

    1. #11
      JPL's Avatar
      JPL
      JPL is offline Sky User Member
      Exchange: Brookwood
      Broadband ISP: Sky Fibre Unlimited
      Router: Sky Q Hub ER110
      Sky TV: Sky Q Silver
      Join Date
      Sep 2008
      Posts
      286
      Thanks
      1
      Thanked 9 Times in 9 Posts

      Re: Hi i need help writing a vbs or batch file to ping an ip address

      Try

      echo %date% %time% >> c:\users\yourname\desktop\ping.txt
      ping 192.168.n.n >> c:\users\yourname\desktop\ping.txt
      JPL


    2. Advertisement
    3. #12
      tarsins's Avatar
      tarsins is offline Sky User Member
      Exchange: Llanelli
      Broadband ISP: Sky Fibre Unlimited Pro
      Router: Sky Q Hub SR203
      Sky TV: Sky Q Silver
      Join Date
      Apr 2008
      Posts
      72
      Thanks
      2
      Thanked 8 Times in 6 Posts

      Re: Hi i need help writing a vbs or batch file to ping an ip address

      Try the following batch file (call it pingtest.bat)

      Code:
      @echo off
      ping %1
      if errorlevel 1 goto fail
      if errorlevel 0 goto pass
      :fail
      set RESULT=fail
      goto end
      :pass
      set RESULT=pass
      goto end
      :end
      echo Ping to %1 %RESULT% at %date% %time% >> pingtest.txt
      for running it:
      pingtest bbc.co.uk
      or
      pingtest 212.58.241.131
      etc.
      --
      Steve

    4. #13
      paulcarrm9mx's Avatar
      paulcarrm9mx is offline Sky User Member
      Exchange:
      Broadband ISP: Max
      Router: Non Sky Router
      Sky TV: Sky Basic
      Join Date
      Mar 2007
      Posts
      767
      Thanks
      3
      Thanked 2 Times in 2 Posts
      Blog Entries
      2

      Re: Hi i need help writing a vbs or batch file to ping an ip address

      Quote Originally Posted by tarsins View Post
      Try the following batch file (call it pingtest.bat)

      Code:
      @echo off
      ping %1
      if errorlevel 1 goto fail
      if errorlevel 0 goto pass
      :fail
      set RESULT=fail
      goto end
      :pass
      set RESULT=pass
      goto end
      :end
      echo Ping to %1 %RESULT% at %date% %time% >> pingtest.txt
      for running it:
      pingtest bbc.co.uk
      or
      pingtest 212.58.241.131
      etc.
      Quote Originally Posted by JPL View Post
      Try

      echo %date% %time% >> c:\users\yourname\desktop\ping.txt
      ping 192.168.n.n >> c:\users\yourname\desktop\ping.txt
      You Guys are ace both Solutions work a treat. also here's my attempt with parts from both your solutions
      Attached Files Attached Files

    5. #14
      dragon2611's Avatar
      dragon2611 is offline Sky User Member
      Exchange:
      Broadband ISP: AAISP + Sky Fibre Unlimited
      Router: Non Sky Router
      Sky TV: N/A
      Join Date
      Jan 2012
      Posts
      1,242
      Thanks
      9
      Thanked 103 Times in 91 Posts

      Re: Hi i need help writing a vbs or batch file to ping an ip address

      Try %USERPROFILE%\desktop instead of hard-coding the user path as this should then place it on the desktop of whoever logs in rather than try and put it in your desktop specifically (which the other users probably don't have access to write to)

      Also you can use the task scheduler or the startup section of the start menu to make it auto run with each login.

     

     
    Page 2 of 2 FirstFirst 12

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    SkyUser - Copyright © 2006-2020. SatDish and NewsreadeR | SkyUser is in no way affiliated with Sky Broadband / BSkyB
    RIPA NOTICE: NO CONSENT IS GIVEN FOR INTERCEPTION OF PAGE TRANSMISSION