我想寫一個批處理文件,其效果如下。 這是我做手工(我想程序自動執行):用於配置我的網絡設備的批處理文件
1) START -> Run -> cmd (get command prompt)
2) ipconfig /release
3) START -> Connect to -> Show all connections
4) Right-click "Local Area Network" and click "Properties"
5) Highlight "Internet Protocol (TCP/IP) and click "Properties"
6) Check box "Use the following IP Address"
7) Enter "111.111.111.111" for IP address
8) Enter "255.0.0.0" for Subnet mask
9) Click OK, and Close.
10) Wait 20 seconds
11) START -> Connect to -> Show all connections
12) Check box for "Obtain IP address automatically"
13) Click OK, and close.
14) Wait 20 seconds.
對於這種類型的任務'netsh'比WMI更適合。網絡是一個奇怪的事情,因爲您必須使用大約4或5種不同的工具才能瞭解整個系統。這裏比unixoid系統中的混亂要好得多。 – Joey 2009-10-26 00:25:27