Vbscript 一次打开多个程序的VB脚本

Vbscript 一次打开多个程序的VB脚本,vbscript,Vbscript,对,我正在寻找一个脚本,我可以点击后,我已经登录打开各种程序,只是为了节省我一点时间。我已经设法得到一个脚本来打开一个,但作为一个新手,有人可以提供建议 Dim objShell Set objShell = WScript.CreateObject( "WScript.Shell" ) objShell.Run """C:\Program Files (x86)\servicecenter\Run\scguiw32.exe "" ""- express:dvla.servicecenter.

对,我正在寻找一个脚本,我可以点击后,我已经登录打开各种程序,只是为了节省我一点时间。我已经设法得到一个脚本来打开一个,但作为一个新手,有人可以提供建议

Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run """C:\Program Files (x86)\servicecenter\Run\scguiw32.exe "" ""-

express:dvla.servicecenter.fs.fujitsu.com.12680"""
Set objShell = Nothing

我没有scguiw32.exe,所以我创建了一个简单的脚本,可以在记事本和word中打开文件

Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run "C:\Windows\notepad.exe c:\dump.txt"

objShell.Run """C:\Program Files (x86)\Microsoft Office\Office14\winword.exe"" c:\dump.txt"
Set objShell = Nothing
顺便说一句,您现在可以使用powershell而不是vbscript,而且powershell脚本更容易理解。例如,上面的一个示例是:使用内容创建run.ps1

& 'C:\Program Files (x86)\Microsoft Office\Office14\WINWORD.EXE' c:\dump.txt
notepad.exe C:\dump.txt

单击它右键单击并选择“使用Powershell运行”

以下是如何使用vbscript创建要运行的程序数组,然后执行每个程序

'---Declare Variables
Dim objShell, strprogram1, strProgram2, colprograms, item

'---Create Scripting Shell Object
Set objShell = CreateObject("WScript.Shell")

'---Create Program Variables
strProgram1 = """C:\Program Files (x86)\servicecenter\Run\scguiw32.exe"" ""-express:dvla.servicecenter.fs.fujitsu.com.12680"""
strProgram2 = "C:\Windows\notepad.exe C:\Dump.txt"

'---Add Variables to an Array
colPrograms = Array(strProgram1,strProgram2)

'---Run each program in the array once
For Each item In colprograms
    objShell.Run item
Next

WScript.Echo "Done."

对于此作业,使用VBScript或Powershell可能有点过度考虑。批处理文件可以工作

@echo off
start "c:\Program Files\Folder 1\program.exe"
start "c:\Program Files\Folder 2\program.exe" -switch -argument
exit

dump.txts文件从何而来dump.txt只是传递给exe文件的参数的一个示例您能否根据我写的问题为powershell编写脚本?我可能会这样:&“C:\Program files(x86)\servicecenter\Run\scguiw32.exe”“-express:dvla.servicecenter.fs.fujitsu.com.12680”还有一个替代方案。运行powershell。键入启动进程-文件路径“C:\Windows\notepad.exe”-参数列表“C:\dump.txt”。键入路径时可以使用TAB键
Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("Path to program")
wscript.sleep (100)
objShell.Run("Path to program")
wscript.sleep (100)
wscript.quit