DOS "ROUTE" command

Reply

Join Date: Sep 2003
Posts: 2
Reputation: JCSAYRE is an unknown quantity at this point 
Solved Threads: 0
JCSAYRE JCSAYRE is offline Offline
Newbie Poster

DOS "ROUTE" command

 
0
  #1
Sep 10th, 2003
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 27
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: DOS "ROUTE" command

 
0
  #2
Oct 9th, 2003
I think I'm missing something... Where is your question? hehe
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Join Date: Sep 2003
Posts: 2
Reputation: JCSAYRE is an unknown quantity at this point 
Solved Threads: 0
JCSAYRE JCSAYRE is offline Offline
Newbie Poster

Re: DOS "ROUTE" command

 
0
  #3
Oct 9th, 2003
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?
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 898
Reputation: Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light Tekmaven is a glorious beacon of light 
Solved Threads: 27
Moderator
Tekmaven's Avatar
Tekmaven Tekmaven is offline Offline
The C# Man, Myth, Legend

Re: DOS "ROUTE" command

 
0
  #4
Oct 10th, 2003
Shell("C:\Path\to\app.exe")
-Ryan Hoffman

.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC