I have written a script on Windows 7 which keeps giving me an error of "( was unexpected at this time." for the following code
if %vardns%=="NODNS" (
netsh interface ipv4 set address name="%__ethAdapter.42%" source=static addr=%varip_old% mask=%varsubnet_old% gateway=%vargateway_old% gwmetric=1
) else (
netsh interface ipv4 set address name="%__ethAdapter.42%" source=dhcp
)
I am not sure where the issue lies and have read many other posts. Any help would be kindly appreciated. Thanks in advance.
if %vardns%==NODNS (I.e. no quotes but I would not have thought that's causing that error%vardns%doesn't have special characters.