Dirk98 Posted September 9, 2007 Share Posted September 9, 2007 Guys, does anyone know netsh command?I need an example of full command to set IP address to the network interface "Local Area Connection" , static, 192.168.3.35, subnet 255.255.255.0 gateway 192.168.3.1.It is here in the link below, but I don't understand how to syntax it properly (need a concrete example):Netsh Commands for Interface IPMany thanks. Link to comment Share on other sites More sharing options...
herewasplato Posted September 9, 2007 Share Posted September 9, 2007 Sure - now I see this post of yours... :-)I replied to your other thread and I suggested that you search the forum for netsh - but I also gave you some code that will change your IP settings "the hard way":http://www.autoitscript.com/forum/index.ph...st&p=400661-MSP- [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
ChrisL Posted September 9, 2007 Share Posted September 9, 2007 Guys, does anyone know netsh command? I need an example of full command to set IP address to the network interface "Local Area Connection" , static, 192.168.3.35, subnet 255.255.255.0 gateway 192.168.3.1. It is here in the link below, but I don't understand how to syntax it properly (need a concrete example): Netsh Commands for Interface IP Many thanks. $netname = "Local Area Connection" $newIp = "192.168.3.35" $newSubnet = "255.255.255.0" $newDG = "192.168.3.1" runwait ('netsh interface ip set address name=' & '"' & $netname & '" static ' & $newIP & ' '& $newSubnet & ' ' & $newDG & ' 1',"",@SW_Hide) and if your interested this is dhcp $netname = "Local Area Connection" runwait ('netsh interface ip set address name=' & '"' & $netname & '" dhcp', "", @SW_HIDE) [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Dirk98 Posted September 9, 2007 Author Share Posted September 9, 2007 Guys, THANK you so much! Can't wait to try them all out. (Didn't think anyone would have wanted to waste his time on this request). Dirk. Link to comment Share on other sites More sharing options...
Dirk98 Posted September 9, 2007 Author Share Posted September 9, 2007 (edited) $netname = "Local Area Connection" $newIp = "192.168.3.35" $newSubnet = "255.255.255.0" $newDG = "192.168.3.1" runwait ('netsh interface ip set address name=' & '"' & $netname & '" static ' & $newIP & ' '& $newSubnet & ' ' & $newDG & ' 1',"",@SW_Hide) and if your interested this is dhcp $netname = "Local Area Connection" runwait ('netsh interface ip set address name=' & '"' & $netname & '" dhcp', "", @SW_HIDE) Chrisl, what a quaint and compact solution you suggested there! Worked like a charm. And it's so easy compared to the monster codes that are far beyond my depth. If I were entering it as a command line what it would look like? Could you please extract the command line from this: runwait ('netsh interface ip set address name=' & '"' & $netname & '" static ' & $newIP & ' '& $newSubnet & ' ' & $newDG & ' 1',"",@SW_Hide) Thanks again! Edited September 9, 2007 by Dirk98 Link to comment Share on other sites More sharing options...
Dirk98 Posted September 9, 2007 Author Share Posted September 9, 2007 If I were entering it as a command line what it would look like? Could you please extract the command line from this: runwait ('netsh interface ip set address name=' & '"' & $netname & '" static ' & $newIP & ' '& $newSubnet & ' ' & $newDG & ' 1',"",@SW_Hide) Thanks again! Is it something like netsh interface ip set address name Local Area Connection 192.168.3.35 255.255.255.0 192.168.3.1 ? Sorry, I couldn't figure this out when I asked in the beginning, and it doesn't work now when I'm trying to manually enter it in START/RUN. Don't get me wrong though, the script works perfect. I'm just trying to do some reverse engineering on it. Link to comment Share on other sites More sharing options...
ChrisL Posted September 9, 2007 Share Posted September 9, 2007 (edited) netsh interface ip set address name= "Local Area Connection" 192.168.3.35 255.255.255.0 192.168.3.1 1 Note name= and speach marks and the additional space 1 at the end Edited September 9, 2007 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now