set wsh=wscript.createobject("wscript.shell")
wsh.run "%windir%\system32\cmd.exe"
"%windir%\system32\cmd.exe"就是命令提示符
wsh.run "%windir%\system32\cmd.exe"就是打开命令提示符
以下VBS代码可打开文件夹E:\tool,同时打开CMD并运行命令ipconfigDim MZ
Set MZ=WScript.CreateObject("WScript.shell")
MZ.run "E:\tool"
MZ.run "cmd /k ipconfig"
有两种运行方法:1在windows界面下运行,也就是双击
2在命令提示符下运行,方法为:
开始,输入cmd回车,然后会d出一个黑框,输入cd “你的vbs所在的地方”回车,然后输入脚本的名字回车就运行了
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)