forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Ping/Tracert using DOS commands...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Sun Mar 31, 2002 11:05 pm    Post subject: Ping/Tracert using DOS commands... Reply with quote

Here's a PING/TRACERT program that uses DOS commands.
It plays a sound file named "alarm.wav" when finished (if you
have a file with this name in the working directory). Also lists
the command options you can use.
__________________________________________________________________________________________________________________________
Code:

OPTION SCALE, 96
OPTION DECIMALSEP, "."
TITLE "By Mac"
DIALOG CREATE, "Ping/Tracert by Mac",-1,0,450,240
  DIALOG ADD,STYLE,BoldText,MS Sans Serif,8,B
  DIALOG ADD,STYLE,List_Style,Courier,8,

  DIALOG ADD,RADIO,Radio1,0,5,75,50," Proc ",Ping|Tracert,"Ping",,BoldText

  DIALOG ADD,TEXT,Text1,5,85,,,"I.P. or Web Address",,BoldText
  DIALOG ADD,EDIT,Edit1,20,85,360,20
  DIALOG ADD,TEXT,Text2,49,154,,,"Options",,BoldText
  DIALOG ADD,EDIT,Edit2,46,200,245,20

  DIALOG ADD,BUTTON,Start,46,85,65,20,,,DEFAULT,BoldText

  DIALOG ADD,TEXT,DataListTxt,55,5,,,"Results:",,BoldText
  DIALOG ADD,LIST,DataList,70,5,440,120,,BoldText,CLICK
  DIALOG ADD,COMBO,HelpList,195,5,440,20," - Type Options in text box above (Options) -",,List_Style

  DIALOG ADD,STATUS,Status,"Ready...",,BoldText
DIALOG SHOW
rem -- Put horizontal slider on list --
%z = @sendmsg(@winexists(~DataList),$0194,2000,0)

LIST LOADTEXT, HelpList,
" - Type Options in text box above (Options) -
"
"PING Options:
"-t             Ping host until interrupted.
"-a             Resolve addresses to hostnames.
"-n x           Number of echo requests to send.
"-l size        Send buffer size.
"-f             Set Don't Fragment flag in packet.
"-i TTL         Time To Live.
"-v TOS         Type Of Service.
"-r x           Record route for x hops.
"-s x           Timestamp for x hops.
"-j host-list   Loose source route along host-list.
"-k host-list   Strict source route along host-list.
"-w x           Wait x milliseconds for each reply.
"
"TRACERT Options:
"-d             Don't resolve addresse to hostname.
"-h x           Max number of hops to search.
"-j host-list   Loose source route along host-list.
"-w x           Wait x milliseconds for each reply.
"

:EVLOOP
  DIALOG FOCUS, Edit1
  WAIT EVENT
  goto @event()

:StartBUTTON
  LIST CLEAR, DataList
  if @dlgtext(Edit1)
     %s = @dlgtext(Edit2)
     %t = @datetime()
     DIALOG SET, Status, Please Wait...
     RUNZ command /c @dlgtext(Radio1) %s @dlgtext(Edit1) > c:\zzzzping.dat, WAIT
     if @file(c:\zzzzping.dat)
        %t = @fsub(%t, @datetime())
        DIALOG SET, Status, "Elapsed Time (hr:min:sec): "@datetime(hh:nn:ss, %t)
        LIST LOADFILE, DataList, c:\zzzzping.dat
        if @file(alarm.wav)
           PLAY alarm.wav
        end
        WAIT
        FILE DELETE, c:\zzzzping.dat
     else
        INFO Cannot retrieve data@tab()
     end
  else
     INFO No Site To @dlgtext(Radio1)@tab()
  end
  goto EVLOOP

:DataListCLICK
  CLIPBOARD SET, @item(DataList)
  INFO Copied to clipboard:@cr()@cr()@item(DataList)
  goto EVLOOP

:CLOSE
  EXIT
  STOP

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group