简体   繁体   English

如何以编程方式更改工作站的IP地址?

[英]How do I programmatically change workstation's ip address?

There's probably some nice way of doing it (in Windows XP) in VBScript (or some other scripting language) with registry tweaks. 在VBScript(或其他一些脚本语言)中使用注册表调整可能有一些很好的方法(在Windows XP中)。 Anyone know how? 谁知道怎么样?

well if you don't mind just doing a regular batch script then you can use the netsh tool 好吧,如果你不介意只是做一个普通的批处理脚本,那么你可以使用netsh工具

It's been a while but I believe the command is something like this: 已经有一段时间但我相信命令是这样的:

netsh interface ipv4 set address name=”Local Area Connection” source=static address=<ip address> mask=<netmask> gateway=<router ip address>

As far as vbscript and such I have no idea but I'm sure it's possible. 就vbscript而言,我不知道,但我确信它是可能的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM