0
votes

i need set the IP and Default gateway for my internet connection by bat file. in CMD.exe run as Administrator my command worked as well but i create bat file and write my Command like this

@Echo off
netsh
interface ip set address name="Local Area Connection" static 192.168.10.42 255.255.255.0 192.168.1.1

but if i run the bat file it wait at first line

netsh>

please help me to find out: Why my bat file dose not work.(sorry for my bad English)

1
Why do you put the arguments on the next line then? - CodeCaster
All the options for the NETSH command have to be on the same line as NETSH. - Squashman
thank you for helping ` netsh interface ip set address name="Local Area Connection" stat ic 192.168.10.42 255.255.255.0 192.168.1.1 ` - abdol-hamid Hosseiny

1 Answers

0
votes

The bat file must be run as Administrator to set IP address.