Jump to content
Sign in to follow this  

Editing TCP/IP Properties for LAN

Recommended Posts



I made a script that will configure the TCP/IP settings for the LAN connection. The only thing missing is how to bring up the window programmatically. As it is, I have to manually open the properties window before my script takes over.

Is there any reliable way to bring up that window through code? The assumptions are that there is only one LAN connection but the its name may be variable.

Also, as an aside, is there any way for AutoIt to interact well with flash menus? I tried creating an installation script for Blackberry Desktop Manager 4.7 but is says that the flash menu that appears when you run the installer is just one big control. Using click coordinates is unreliable.

Is there anyone with a better idea?

My installer copy was taken from the CD packaged with the unit.

Share this post

Link to post
Share on other sites

Answer to question number 1..

Set the ipadress from command prompt by using run(). Check how this is done

Edited by Manjish

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post

Link to post
Share on other sites

may this help

#include <Constants.au3>

local $command
local $data

While 1

        $command = Run(@ComSpec & " /c " & "netsh interface ip show config","", @SW_HIDE , $STDERR_CHILD + $STDOUT_CHILD);
        While 1
         $data &= StdoutRead($command)
         If @error Then ExitLoop
        $data = StringReplace($data, @LF,"")
    $data = StringSplit ($data, @CR)
for $i = 1 to $data[0]

        case stringinstr ($data[$i], "Configuration for interface ")

         $config = StringReplace ($data[$i], "Configuration for interface ","")


        case Else
Run(@ComSpec & " /c " & 'netsh interface ip delete address ' & $config & ' gateway=all', "", @SW_HIDE);


Share this post

Link to post
Share on other sites

Thanks for the help. I now have a working TCP/IP configuration script.

Netsh works well when editing settings but I can't seem to make 'dump <file>' or 'set file' work outside of netsh. I mean just running the command from the command prompt, instead of from the netsh prompt.

I can make 'set file open <file>' work when inside the netsh prompt but can't call it using 'netsh interface ip set open <file>' in the command prompt. 'dump <file>' fails me from the start, it only prints the info in the command console but doesn't dump it in a file. I can only make 'set file' work in the command prompt by using 'netsh exec <script>'.

I'm using XP sp3. Anyone experiencing the same thing?

Also, is there any way of capturing text that dos commands output in the command console?

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