executing two functions with wshshell

Posted by sushant on Stack Overflow See other posts from Stack Overflow or by sushant
Published on 2010-03-25T06:42:38Z Indexed on 2010/03/25 8:23 UTC
Read the original article Hit count: 397

Filed under:

i have two different functions (copy and zip) to b executed. can i do it with with a single wshshell script.i tried----

Dim WshShell, oExec,g,h
h="D:\d"

g="xcopy " & h & " " & "D:\y\ /E & cmd /c cd D:\c & D: & winzip32.exe -min -a D:\a"
Set WshShell = CreateObject("WScript.Shell")

Set oExec = WshShell.Exec(g)

Do While oExec.Status = 0
     WScript.Sleep 100
Loop

WScript.Echo oExec.Status

it dint work.though separate programs i.e g="xcopy " & h & " " & "D:\y\ /E" and g="cmd /c cd D:\d & D: & winzip32.exe -min -a D:\a" works. i am sorry for the formatting problem. any help is appreciated.

© Stack Overflow or respective owner

Related posts about vbscript