Change Gateway Programmatically

G

Godwin Burby

Dear Pythoneer,
I need to toggle the gateway ip of my windows xp machine quite
often due to some software requirements. I just want to know whether i
could do it programmatically using Python.
If so how?
 
B

bonono

Godwin said:
Dear Pythoneer,
I need to toggle the gateway ip of my windows xp machine quite
often due to some software requirements. I just want to know whether i
could do it programmatically using Python.
If so how?

I am sure there must be some elegant python way but you may also like
to check out "netsh.exe", which comes with every XP.
 
F

Fredrik Lundh

Godwin said:
I need to toggle the gateway ip of my windows xp machine quite
often due to some software requirements. I just want to know whether i
could do it programmatically using Python.
If so how?

os.system("route ...") could work.

for details on the route command, use "route /?" at the windows command
prompt.

</F>
 
G

Godwin Burby

Well netsh turned out to be the perfect solution for my problem(even
though doing it in python would have given me some kicks). I managed it
with two .bat files for toggling the gateway ips. Thank you friend.
 
B

bonono

Godwin said:
Well netsh turned out to be the perfect solution for my problem(even
though doing it in python would have given me some kicks). I managed it
with two .bat files for toggling the gateway ips. Thank you friend.

there is os.system/os.open* if you want to put python in the equation
;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top