path 是系统搜索可执行文件的路径,如果设置为别的,那么执行命令时可能提示找不到路径。
E:\Cmd>set xpath=%path%
E:\Cmd>set path=
E:\Cmd>ping
'ping' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
E:\Cmd>ipconfig
'ipconfig' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
E:\Cmd>winver
'winver' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
E:\Cmd>ver
Microsoft Windows XP
E:\Cmd>set path=%xpath%
E:\Cmd>ipconfig
Windows IP Configuration
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.1.111
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
E:\Cmd>