February 27th, 2013, 09:23 PM
Batch script question!
Hey guys my name is droidkid, i'm working on a script to do with changing dns. here is an example of my problem
my problem is it closes the window and dose not display the last echo output. (this is just an example of my problem) however if i remove the exit /B the script will not run properly? its so odd I want to be able to read the echo %~2 but instead it closes right away?
For /f "skip=2 tokens=4*" %%a In ('NetSh Interface IPv4 Show Interfaces') Do (
Call :UseNetworkAdapter %%a "%%b"
:: %1 = State
:: %2 = Name (quoted); %~2 = Name (unquoted)
If "%1"=="connected" (
:: Do your stuff here, for example:
echo Hey this is the end of the script