如何同時(shí)運行多個(gè)程序?
-- by benbenknight
---------------------------------
文件RunS1.bat:
echo off
rem RunS1.bat
rem 同時(shí)串行運行多個(gè)程序
set cmd1=D:test1
set cmd2=D:test2
call %cmd1%
call %cmd2%
---------------------------------
文件RunS2.bat:
echo off
rem RunS2.bat
rem 同時(shí)串行運行多個(gè)程序
set cmd1=D:test1
set cmd2=D:test2
%cmd1%
%cmd2%
---------------------------------
文件RunP.bat:
echo off
rem RunP.bat
rem 同時(shí)并行運行多個(gè)程序
set cmd1=D:test1
set cmd2=D:test2
start %cmd1%
start %cmd2%
---------------------------------
---------------------------------
文件RunS.vbs:
' RunS.vbs
' 同時(shí)串行運行多個(gè)程序
strCmd1 = "D:\test1.exe"
strCmd2 = "D:\test2.exe"
Set wshShell = CreateObject("WScript.Shell")
nWindowStyle = 1 ' 激活并顯示窗口
bWaitOnReturn = 1 '等待程序執行完畢再執行下一條語(yǔ)句
wshShell.Run strCmd1,nWindowStyle,bWaitOnReturn
wshShell.Run strCmd2,nWindowStyle,bWaitOnReturn
---------------------------------
文件RunP1.vbs:
' RunP1.vbs
' 同時(shí)并行運行多個(gè)程序
strCmd1 = "D:\test1.exe"
strCmd2 = "D:\test2.exe"
Set wshShell = CreateObject("WScript.Shell")
nWindowStyle = 1 ' 激活并顯示窗口
bWaitOnReturn = 0 '不必等待程序執行完畢再執行下一條語(yǔ)句
wshShell.Run strCmd1,nWindowStyle,bWaitOnReturn
wshShell.Run strCmd2,nWindowStyle,bWaitOnReturn
---------------------------------
文件RunP2.vbs:
' RunP2.vbs
' 同時(shí)并行運行多個(gè)程序
strCmd1 = "D:\test1.exe"
strCmd2 = "D:\test2.exe"
Set wshShell = CreateObject("WScript.Shell")
wshShell.Exec(strCmd1)
wshShell.Exec(strCmd2)
---------------------------------
聯(lián)系客服