IPV4 assign static or dynamic IP automatically
-
Monday, November 26, 2012 4:09 PM
Good morning,
I must often change my static IP and subnetmask from my D-Link, I am using W7 Professional 64Bit. I searched and found that one can create .batch file using for example:
NETSH INTERFACE IPV4 SET ADDRESS “Local Area Connection” STATIC 192.168.0.2 255.255.255.0 192.168.0.1
and then running them as an administrator should automatically change my settings without doing it manually. However this isn't working on my side. Running the batch file then directly typing in the cmd "ipconfig /all" I can see no changes on my D-Link (named LAN-Verbindung 3 in my cmd). Am I doing something wrong? I thank you for your kind support.
All Replies
-
Monday, November 26, 2012 8:01 PM
The problem is probably that your network card is not named "Local Area Connection".
Try
NETSH INTERFACE IPV4 SET ADDRESS "LAN-Verbindung 3" STATIC 192.168.0.2 255.255.255.0 192.168.0.1
Also, the quotes should be "straight quotes", not "opening and closing" quotes like in the example you provided. BTW this is a common hurdle when copying and pasting code from the web.
- Marked As Answer by Arnaud844 Tuesday, November 27, 2012 7:42 AM
-
Tuesday, November 27, 2012 7:41 AMI Thank you very much now everything is working fine and I am able to change my D-Link as I please using different batch files instead of going through everything manually

