Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: setting ip address on win32 machine in perl

by joefission (Monk)
on Aug 17, 2001 at 21:44 UTC ( #105744=note: print w/replies, xml ) Need Help??


in reply to setting ip address on win32 machine in perl

Never seen any modules to do this. Here's how I'd do it on NT 4 (and I hope there's an easier way than this...)

You'll want to use Win32::TieRegistry. Connect to
HKLM/SYSTEM/CurrentControlSet/Control/Services/Tcpip/Linkage/

Look at the Bind (maybe Export, but Bind should work) value. The device is contained in the data.
Now, connect to
HKLM/SYSTEM/CurrentControlSet/Control/Services/$device/Parameters/TcpipThe IP address, subnet mask, and default gateway are values within.

Use regedt32 to see these values, it will help you write the regex for the device.

Replies are listed 'Best First'.
Re: Re: setting ip address on win32 machine in perl
by RayRay459 (Pilgrim) on Aug 17, 2001 at 21:48 UTC
    Thats what my original idea was. A Reg Hack. I too was looking for something more perlish :). Thanks again for your input though. I do appreciate it. Ray

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://105744]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2020-05-24 21:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (140 votes). Check out past polls.

    Notices?