943,796 Members | Top Members by Rank

Ad:
Sep 10th, 2003
0

DOS "ROUTE" command

Expand Post »
Does anyone know of a way to invoke the DOS "ROUTE" command(s). I have written a .bat program that adds routes, but I want to take a particular interface from my ROUTE PRINT output and then ROUTE ADD the routes to that interface. Since that interface is dynamic due to VPN issues, it would be great if I could write a little program that would first determine the interface ID (such as 0x2000005) and then create the routes via ROUTE ADD. TIA.

-jcs
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
JCSAYRE is offline Offline
2 posts
since Sep 2003
Oct 9th, 2003
0

Re: DOS "ROUTE" command

I think I'm missing something... Where is your question? hehe
Moderator
Reputation Points: 322
Solved Threads: 28
The C# Man, Myth, Legend
Tekmaven is offline Offline
914 posts
since Feb 2002
Oct 9th, 2003
0

Re: DOS "ROUTE" command

It's been brought to my attention that my quetion isn't very clear, which I have to agree with. Here's my question:
In Vis.Basic, how can I determine the active interfaces on my computer? I can do this with the DOS command, "ROUTE PRINT" but I would like to be able to do something like the following psuedo-code:

DIM WAN, TEMP AS STRING
DIM IPADDRESS, GATEWAY AS STRING

IPADDRESS = "1.2.3.4" 'YES I KNOW THIS IS A BOGUS IP ADDY
GATEWAY = "5.6.7.8" ''YES I KNOW THIS IS A BOGUS IP ADDY TOO

TEMP = ROUTE PRINT | FIND "WAN"
WAN = MID (TEMP,2,7)
ROUTE ADD IPADDRESS GATEWAY METRIC 2 IF (THIS IS INTERFACE, NOT "IF" STATEMENT) WAN

What I don't know how to do is determine the active interfaces, routes, etc. from visual basic. I can do it from DOS, but I want to do it from VB. I am sure that there's some API or DLL that I should be using, but I can't seem to figure it out. So, how do I call the DOS command, "ROUTE" from visual basic?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
JCSAYRE is offline Offline
2 posts
since Sep 2003
Oct 10th, 2003
0

Re: DOS "ROUTE" command

Shell("C:\Path\to\app.exe")
Moderator
Reputation Points: 322
Solved Threads: 28
The C# Man, Myth, Legend
Tekmaven is offline Offline
914 posts
since Feb 2002

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Drag and Drop controls?
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: multiform windows appliction in VB . NET





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC