Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sun Mar 31, 2002 11:05 pm Post subject: Ping/Tracert using DOS commands... |
|
|
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
 |
|