![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Grabbing IP address then setting to 2nd nic I am trying to combine code which grabs the ip address of a server from http://groups.google.com/group/micro...751466d5406803 then set it to a 2nd NIC via the netsh command netsh interface ip set address "Local Area Connection 2" static IP ADDRESS is it possible to set this as a variable obtained from code in the 1st part??? Also have been trying to use the the netsh command for only the ipaddress without wiping the rest of the details ie subnet/default gateway/dns etc. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Grabbing IP address then setting to 2nd nic "drunkeninja" <shaolindriver@xxxxxx> wrote in message news:767ff9c7-53af-4412-986b-868e09f80e08@xxxxxx Quote: >I am trying to combine code which grabs the ip address of a server > from > http://groups.google.com/group/micro...751466d5406803 > > then set it to a 2nd NIC via the netsh command > > netsh interface ip set address "Local Area Connection 2" static IP > ADDRESS > > is it possible to set this as a variable obtained from code in the 1st > part??? > > Also have been trying to use the the netsh command for only the > ipaddress without wiping the rest of the details ie subnet/default > gateway/dns etc. considerably if you used a batch file to extract and set your IP address instead of shelling out of a VB Script. The following code will do it: 1. @echo off 2. net start | find /i "Routing and Remote Access" > nul && goto Netsh 3. sc config "RemoteAccess" start= demand 4. net start "RemoteAccess" 5. 6. :Netsh 7. for /F %%a in ('netsh interface ip show ipaddress ^| find /i "wireless"') do set IP=%%a 8. echo IP=%IP% You must replace the word "wireless" with a non-ambiguous word of your own NIC as shown in the Interface column of the command netsh interface ip show ipaddress Be careful with Line 3 - the space following the = is critical. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Setting-up address folders in Windows Mail? | Vista mail | |||
| Vista assigns 0.0.0.0 IP address when setting up static IP | Vista networking & sharing | |||
| setting for replies: receiver address - not default address | Vista mail | |||
| Setting up Hotmail address | Vista General | |||
| MAC address setting on Vista | Vista networking & sharing | |||