怎么在VBS脚本中运行多个程序,但是在窗口里选择运行其中一个或者多个程序

如题所述

dim a
set ms=createobject("wscript.shell")
a=inputbox("a = 记事本"+chr(13)+"b = 命令行提示符","请输入","a")
if a="a" then
ms.run "notepad.exe"
else if a="b" then
ms.run "cmd.exe"
end if
end if

追问

能教我具体怎么用以及出来的效果如何吗,我会采纳的,并且检查一下,谢谢

追答

可以,怎么教???

追问

那个脚本,有什么地方是要根据实际情况更改的?哪些是照搬进去的?还有运行出来的效果是怎么样的

追答

远程吧,QQ百度HI

追问

不,在这回答,谢谢

追答dim a
set ms=createobject("wscript.shell")'引用对象
a=inputbox("a = 记事本"+chr(13)+"b = 命令行提示符","请输入","a")'显示的输入框,里面可以添加,默认值为a
if a="a" then'当输入的值为a时执行记事本
ms.run "notepad.exe"
else if a="b" then'当输入的是b时执行命令行提示符,语句可以添加
ms.run "cmd.exe"
end if
end if

温馨提示:答案为网友推荐,仅供参考
相似回答