查看: 1198|回复: 3
|
在batch script 里 - 如何写net command - 要写换ip address script
[复制链接]
|
|
command 已经有前任高手给了.如下,
open administrator cmd
-netsh
-interface ip config
-interface ip set address name="local area connection" static 15.0.2.22 255.0.0.0 15.0.2.180
-interface ip set dns "local area connection" static 15.0.0.2
要如何的把他改为batch script给用户double click 就好。
|
|
|
|
|
|
|
|
发表于 7-4-2015 08:10 PM
|
显示全部楼层
- @echo off
- netsh interface ip set address name="local area connection" static 15.0.2.22 255.0.0.0 15.0.2.180
- netsh interface ip set dns "local area connection" static 15.0.0.2
复制代码
save 成 .bat 文件
然后叫 user right click run as administrator
要不然你就自己开一个shortcut,在shortcut里面force run as admin
http://stackoverflow.com/questio ... s-run-as-admin-mode |
|
|
|
|
|
|
|
发表于 7-4-2015 08:59 PM
|
显示全部楼层
folder option 里,hide extensions for known file types 取消打勾
要建立文件的地方/文件夹,滑鼠右击 〉new text document
打开文件,输入内容如下,然后储存
netsh interface ip set address "local area connection" static 15.0.2.22 255.0.0.0 15.0.2.180 1
netsh interface ip set dns "local area connection" static 15.0.0.2
把文件格式 txt 改成 cmd,完成
ps:一楼内容少了 gateway metric |
|
|
|
|
|
|
|

楼主 |
发表于 8-4-2015 03:41 PM
|
显示全部楼层
|
|
|
|
|
|
| |
本周最热论坛帖子
|