I'm trying to create a hotkey to set google dns on all found interfaces.
The easiest way seems to be via wmic with
Code: Select all
wmic nicconfig where (IPEnabled=TRUE) call SetDNSServerSearchOrder ("8.8.8.8", "8.8.4.4")
I tried to set it up in ahk via the following code, but I'm getting "Return Value=70" wich translates to "Invalid Ip Adress".
Code: Select all
g::Run,%comspec% /k wmic nicconfig where (IPEnabled=TRUE) call SetDNSServerSearchOrder ("8.8.8.8", "8.8.4.4")
Since the DNS adress is the only one specified I guess thats the "invalid adress" and I suspect that the quotes or some other symbol in the expression has to be escaped somehow, but for the life of me I can't figure out how... I've multiple sultions like double the quotes, double the quotes and ', for the comma...still no go