我不认为你可以这样做:经营者是指挥线的载体的一部分,而不是制造厂或壳牌照。
我看到这方面工作的若干途径:
- call CMD.exe and pass your command-line as parameter. (i.e. "%ComSpec% /c " & Stuff)
- Write a batch on the fly and execute it.
- Just write two calls to WshShell.Exec instead of one. It s probably better since you can check the result of each individual part of the process anyway. You can even do the copy in script instead of calling xcopy for extra error checking and loging.
这里是一部关于如何复制双倍的样本代码,然后在VB文本中相互tz:
Dim WshShell, oExec, oFS, oF
szSourcePath="c: mp estfolderSrc"
szDestinationPath="c: mp estfolderDest"
szDestinationZip="c: mpfinal.zip"
bOverwrite=true
Create objects
Set oFS = CreateObject("Scripting.FileSystemObject")
Set WshShell = CreateObject("WScript.Shell")
cleanup target folder
if oFS.FolderExists(szDestinationPath) then
oFS.DeleteFolder szDestinationPath, true
end if
Create target folder
set oF = oFS.CreateFolder(szDestinationPath)
Copy content of the source folder to the target folder
oFS.CopyFolder szSourcePath & "*", szDestinationPath, bOverwrite
delete old zip
if oFS.FileExists("c:myzip.zip") then
oFS.deleteFile("c:myzip.zip")
end if
wshShell.CurrentDirectory = "c: mp" set current directory to this
Set oExec = WshShell.Exec("c:program fileswinzipwinzip32.exe -min -a c:myzip.zip" )
Do While oExec.Status = 0
WScript.Sleep 100
Loop