Sign in to follow this  
Followers 0
cramaboule

Set your IP address easly

14 posts in this topic

#1 ·  Posted (edited)

Hello all,

Instead of clicking serveral times to change my IP address on my laptop (as I have to do so sometimes) I created a small GUI that does that very easly ! (yes, I know I am lazy :) )

Thanks martin for your help

I tested only in XP (not sure if it works in Vista)

Based on netsh !

:P

Posted Image

EDIT: Finnally the New version:

- Modified the script due to the rename of some UDF

- Fixed some small bugs

- Make improvement !

IMPORTANT you need #include <CompInfo.au3> for this script ! you can find it here

old version dowlloaded 189 times

IPset1.au3

Edited by cramaboule

Share this post


Link to post
Share on other sites



This is my version, with some help from ChrisL

You have the same problem as me - Getting the name of the actual network card.

My script is designed to run on 2 different types of touch screen computer - hence the keypad, but i have no way of getting the name of the card from windows. It also relies on the NetSh being in the same directory as the scrpit, as im not sure of the legality of fileinstalling it.

SetIP.au3

Share this post


Link to post
Share on other sites

this is my version.

Share this post


Link to post
Share on other sites

this is my version.

I've noticed that on some laptops the fonction getmac doesn't work at all !!!

(and I've seen a number !!!)

That' why I am carfull at using it !

but nice one

Share this post


Link to post
Share on other sites

You have the same problem as me - Getting the name of the actual network card.

Not at all,... look at my script about the MAC address !!! :)

Share this post


Link to post
Share on other sites

It's a good script.

It is assumed that @IPAddress1 is the LAN and @IPAddress2 is WiFi but this is not correct. On my laptop it shows the WiFi address blank but in fact it should be the one shown for the LAN. Maybe you could use "netsh interface ip show config" to find this out, or perhaps "ipconfig" would be better.

A useful extra feature would be for people (like me) with laptops who need to connect to different networks. So it would be good if you could save the settings, and load from a choice from a list say..


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

It's a good script.

It is assumed that @IPAddress1 is the LAN and @IPAddress2 is WiFi but this is not correct. On my laptop it shows the WiFi address blank but in fact it should be the one shown for the LAN. Maybe you could use "netsh interface ip show config" to find this out, or perhaps "ipconfig" would be better.

A useful extra feature would be for people (like me) with laptops who need to connect to different networks. So it would be good if you could save the settings, and load from a choice from a list say..

Thanks martin.

yeeeeee, I knoooooow, :) on my laptop when my LAN is not connected my @IPAddress1 become the Wi-Fi.(then display on the LAN side of my script!) I didn't find an easy way to correct it (until now) ipconfig /all is quite "long" or/and difficult. I didn't know about 'netsh interface ip show config', but I can try and even, take the name of the interface !

I'll try to make the change.

One thing Autoit could improve would be this ! (showing the IP by interfaces ! @IPinterface1 for instance in an array ? @IPinterface1[1]=interface and @IPinterface1[2]=IP)

About the profiles stuff,... look the one from 'psandu.ro' it is quite good !

Share this post


Link to post
Share on other sites

it's a good Script. :)

Share this post


Link to post
Share on other sites

it's a good Script. (!)

A compliment from "microsoft",... I don't know if it is a compliment !!!!!

:):P:) (!) (!) (!) :) (!) (!)

but thanks !!!

Share this post


Link to post
Share on other sites

I'll second that - good script!

What would be nice however are some comments in your code so that users with less experience will be able to learn something :)

Don't need to comment all the lines, just the lines that contain stuff that is not so evident.

BTW, I've only seen one defective lan card that didn't show any MAC adress in my life. So any problems reading the MAC is either AutoIT based or Windows based. I've also checked the registry and although the main Lan card's MAC serves to brand your harddrives, the actual MAC never appears in the registry. So when you ask for it, Windows calls up the hardware every time.


I am endeavoring, ma'am, to construct a mnemonic circuit using stone knives and bearskins.SpockMy UDFs:Deleted - they were old and I'm lazy ... :)My utilities:Comment stripperPolicy lister 1.07AutoIT Speed Tester (new!)

Share this post


Link to post
Share on other sites

Thanks martin.

yeeeeee, I knoooooow, :) on my laptop when my LAN is not connected my @IPAddress1 become the Wi-Fi.(then display on the LAN side of my script!) I didn't find an easy way to correct it (until now) ipconfig /all is quite "long" or/and difficult. I didn't know about 'netsh interface ip show config', but I can try and even, take the name of the interface !

I'll try to make the change.

One thing Autoit could improve would be this ! (showing the IP by interfaces ! @IPinterface1 for instance in an array ? @IPinterface1[1]=interface and @IPinterface1[2]=IP)

About the profiles stuff,... look the one from 'psandu.ro' it is quite good !

There's no need to put the functionality in autoit since it has com support. Using WMI its easy to enumerate networkadapters.

And JSthePatriot has written an excellent udf to do so -> http://www.autoitscript.com/forum/index.ph...amp;hl=compinfo

Have fun! :P

Share this post


Link to post
Share on other sites

@Celeri : I Know that it is not on the registry. I've searched for it already. I meant that the fonction getmac is NOT on ervey computer Lapotop. I made one script (link in my signature) to get the MAC address. The first version was based on getmac but was not able find it on the PC for whatever reason. That's why it is based on ipconfig/ all !

@Creator : Cool Sooo great many thanks !

Share this post


Link to post
Share on other sites

Hello all,

Instead of clicking serveral times to change my IP address on my laptop (as I have to do so sometimes) I created a small GUI that does that very easly ! (yes, I know I am lazy :) )

Thanks martin for your help

I tested only in XP (not sure if it works in Vista) and it works only for english and frensh OS !

(you can add you language by yourself just look at the end of the script)

Based on netsh !

:)

cramaboule, your script works ok on my PC with launguage OS (WinXP Pro SP2). You'll be laughing (I'm a newbie), but all I want is just to add my desired IP address, Subnet and Gateway to the end of your script to automate the change of my PC's current IP in one click. Could you please give me a pointer which command to use? I've tried ControlSend, but it doesn't work to some reason.

Many thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0