| | |
DOS "ROUTE" command
![]() |
•
•
Join Date: Sep 2003
Posts: 2
Reputation:
Solved Threads: 0
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
-jcs
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.
.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
•
•
Join Date: Sep 2003
Posts: 2
Reputation:
Solved Threads: 0
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?
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?
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.
.NET Specialist / Webmaster, Extended64.com.
Please do not email or PM me with support questions. Please direct them to the forums instead.
![]() |
Similar Threads
- Return 0; and system ("pause") (C)
- google "keyword" question (Search Engine Optimization)
- "HELP" RUNNING MSDOS COMMAND ON VB (Visual Basic 4 / 5 / 6)
- "preg_match" For What purpose this command use? (PHP)
- "About:blank" problem (Viruses, Spyware and other Nasties)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Drag and Drop controls?
- Next Thread: multiform windows appliction in VB . NET
| Thread Tools | Search this Thread |
* 6 2007 access activex add age basic beginner birth bmp calculator cd cells.find click client code college connection connectionproblemusingvb6usingoledb creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit excel excelmacro file filename form header iamthwee image inboxinvb internetfiledownload listbox listview liveperson login looping microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading remotesqlserverdatabase report save search sendbyte sites sql sql2008 sqlserver subroutine tags time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web windows





