TCP/IP configuration w/ python on Win2k?
Pieter_Claerhout at CreoScitex.com
Fri May 11 09:04:07 CEST 2001
There might be another possibility. Take a look at the netsh command from
Windows. It allows you to dump the current network configuration, and load
it again. It works like:
D:\>netsh interface dump
D:\>netsh exec my_settings.txt
You can redirect the output of the netsh interface dump to a text file and
execute it again with the netsh exec command. Wrap this up in a Python
script that dynamically generates the script file and let it execute it. If
you're using the netsh command, there's no need to reboot the system for the
settings to become active. Just be aware that some settings are not saved
(like DNS suffixes and so on). You can find a lot more information in the
Windows 2000 help files or on http://msdn.microsoft.com/.
PS: ever noticed that this functionality is standard on Macintoshes? Don't
know about Unix though...
Pieter Claerhout - Application Support
CreoScitex Europe - www.creoscitex.com
From: David LeBlanc [mailto:whisper at oz.nospamnet]
Sent: Friday, May 11, 2001 1:17 AM
To: python-list at python.org
Subject: Re: TCP/IP configuration w/ python on Win2k?
In article <7ubsp1w1oh.fsf at gnwy100.wuh.wustl.edu>,
clee at gnwy100.wuh.wustl.edu says...
> I'm interested in using python to quickly change the IP address and
> gateway of a Windows 2000 laptop. (I'm moving around a lot between ports
> with static addresses.) I've looked through the win32all documentation,
> but with my ignorance of windows system administration I may be missing
> Thanks in advance,
grep the registery luke - it's in there somewhere - but you _might_ have
to do a reboot after changing .... oops, Win2k is supposedly immune to
reboots after changing network configurations.
More information about the Python-list