由于Netsh命令在运行时进入另一种命令行状态,需要另外输入命令,所以应该先创建Netsh之后需要输入的命令的一个文本文件,然后再用Netsh导入该文件。即:
先用文本编辑器(如 Edit 或记事本)输入:
interface
ip
set address "本地连接" static 192.168.1.106 255.255.255.0 192.168.1.1 1
quit
然后保存,文件名任意,如 change.txt。
再用netsh命令和“<”导入操作符把change.txt作为输入源:
netsh <change.txt
Since the Netsh command enters another command-line state when running and requires additional commands to be input, you should first create a text file containing the commands that need to be input after Netsh, and then import this file using Netsh. That is:
First, use a text editor (such as Edit or Notepad) to input:
interface
ip
set address "Local Area Connection" static 192.168.1.106 255.255.255.0 192.168.1.1 1
quit
Then save it with any file name, such as change.txt.
Then use the netsh command and the "<" import operator to take change.txt as the input source:
netsh <change.txt