0
我试图做一个批处理文件,当使用将设置IP。我认为我达到了这一点。垮台是我希望它能够在我使用它时传递一个变量。例如SETIP 37.会将变量37插入IP中。批处理文件传递变量为ip
下面是我的代码
rem Network Settings for IP
netsh interface ip set address name = "Local Area Connection" source = static addr = 192.168.10.(target for variable) mask = 255.255.255.0
netsh interface ip set address name = "Local Area Connection" gateway = 192.168.10.1 gwmetric = 1
netsh interface ip set dns name = "Local Area Connection" source = static addr = 192.168.10.1
netsh interface ip show config
pause
你尝试过什么?我会认为通过'“192.168.10。$ var $”'会工作... – 2015-04-02 13:07:26
这将是'%var%',而不是'$ var $'。但是,你可以绝对简单地使用一个变量。 – SomethingDark 2015-04-02 13:16:00