|
Answer» Hello All,
Do anybody know how to assign TWO or more IP address in one NIC CARD using batch script in Windows. I currently i use the below batch script to assign one IP address, then i manually assign another IP address. I searched everywhere in net, could not find idea on this.
One more problem is run the script it executes the first line, it opens chrome and does not executes rest of the lines until i close chrome browser. I tried different option for this "start command.....etc" but nothing worked out.
Please help me out.
#################################
"C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\Application\chrome.exe"
start D:\santhosh\SBM
start D:\santhosh\DOCUMENTS
start D:\santhosh\SBM\SBM-TOKYO
@ECHO OFF
ECHO Enter INPUT for IP assigning static or dhcp
set /P INPUT=
if %INPUT% == "dhcp" goto :dhcp
if %INPUT% == "static" goto :static
:dhcp :: ECHO RESETTING IP Address and Subnet Mask For DHCP [line commented] netsh int ip set address name = "Local Area Connection" source = dhcp
:: ECHO Resetting DNS For DHCP ::netsh int ip set dns name = "Local Area Connection" source = dhcp
:: ECHO Resetting Windows Internet Name Service (WINS) For DHCP ::netsh int ip set wins name = "Local Area Connection" source = dhcp :end
:static netsh interface ip set address name = "Local Area Connection" source = static addr = 172.16.241.224 mask = 255.255.255.0 :end
###############################For your second problem, using a simple "start C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" should start the program and continue on with the batch. If not, you may want to check whether command extensions are enabled or disabled. If enabled, try to write the script to disable the extensions, then start the program, then re enable command extensions afterwards.
Code: [Select]setlocal disableextensions start C:\Documents and Settings\Administrator\Local Settings\Application Data\Google\Chrome\Application\chrome.exe endlocal To set a second IP, I need to ask if you are trying to set an IP for a seperate connection or if you are wanting the one "Local Area Connection" to have two IP addresses. If this is what you are wanting, how exactly are you setting it "manually?"
|