Jump to content

Can Autoit Used To Change Ip Address Remotely?


Recommended Posts

Can someone give me reference of the AutoIT ability to change IP Configuration remotely. I mean i need to change client configuration from DHCP to Static IP without interfere the user. Probably AutoIT can solve my problem :)

No one can gave me a clue? :(

Edited by Elkie
Link to comment
Share on other sites

I don't know your OS. With XP Pro it should work

with netsh and pstools. But I didn't test it...

PSTools: info and download

http://www.sysinternals.com/Utilities/PsTools.html

To save the current network settings, open a dos-shell

and type in: netsh -c interface dump > settings.txt

Now there is a file you can open with notepad and

edit the settings /it should be saved under

C:\Documents and Settings\{Username}\Settings.txt

Here you have to fill in the desired settings for your

remote pc. The file is well documented and will help

you. When you have finished editing save the file.

With psexec.exe you are able to execute commands

remote on other pcs. For further information look

into the help file.

I would do so or something like that:

Create a script and compile it (name changesettings.exe)

$sNewConfig = 'Paste here the complete settings.txt'

$oFile = FileOpen("C:\Settings.txt", 1)

If $oFile = -1 Then Exit
FileWrite($oFile, $sNewConfig)
FileClose($oFile)

RunWait(@Comspec & " /c netsh -f C:\Settings.txt")
FileDelete("C:\Settings.txt")

The the following commandline:

psexec \\IP -u USER -p PASSWORD -c changesettings.exe

I cannot test it, so you will have to try.

Regards, Buffo

Link to comment
Share on other sites

AutoIt can write to the registry of a remote computer:

http://www.autoitscript.com/forum/index.ph...ndpost&p=152360

You can change from DHCP to Static at the key for the active NIC:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\

(You know the current/active IP to double check the key.)

Then you need to make the NIC reread the info:

use psexec and this script to disable/re-enable the NIC:

http://www.autoitscript.com/forum/index.ph...showtopic=21229

(Although I think that a restart would give you less trouble, but I do not know if that meets your criteria of "without interfere the user".)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...