View Single Post
  #5  
Old 02-16-2012, 05:03 PM
zementmischer zementmischer is offline
Member
 
Join Date: Apr 2011
Location: Europe
Posts: 43
Default

Sorry aladdin, but your statement somewhat implies that my batch file isn't working at all.

Did you even bothered to try and see if it works?

Furthermore your 'googled' batch file doesn't even meet your posted requirements ("it should ask in the following order") - hence, it's definitely NOT 100% WORKING. Or did I missed a RFC (Request for Change) somewhere?

Nevertheless you can improve the perfomance of the batch file by combining the first and second call to netsh.exe.

Here's the code - just in case that you don't have the faintest idea of CLI (did you ever made a batch file yourself?)
Code:
@ECHO OFF
SET adapter="Local Area Connection"
SET ipaddr=10.0.83.67
SET subnet=255.255.255.224
SET gateway=10.0.83.66
SET pridns=10.0.1.21
SET secdns=10.0.83.66
netsh interface ip set address %adapter% static %ipaddr% %subnet% %gateway% 1 >NUL
netsh interface ip set dns %adapter% static %pridns% >NUL
netsh interface ip add dns %adapter% %secdns% index=2 >NUL
netsh interface ip show config %adapter%
PAUSE
__________________
Real programmers don't comment their code.
If it was hard to write, it should be hard to read.
Reply With Quote