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?)
SET adapter="Local Area Connection"
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%