출처 : http://nazelm.egloos.com/938351

WshShell.Run

Dim WshShell : Set WshShell = WScript.CreateObject("WScript.Shell")
intError = WshShell.Run (strCommand [, intWindowStyle] [, bWaitOnReturn])
WshShell.Run strCommand [, intWindowStyle] [, bWaitOnReturn]
' cf, 반환값 없이 단독 실행시에는 괄호로 묶지 않는다.

- intError : Error code (실행결과로 해당 명령줄에 의해 실행된 프로그램이 반환하는 정수값)
- strCommand : 명령줄 문장
- intWindowStyle : Optional. ([]로 묶인 항목은 전부 선택항목)
0    Hides the window and activates another window.
1    Activates and displays a window.
     If the window is minimized or maximized, the system restores it to its original size and position.
     An application should specify this flag when displaying the window for the first time.
2   Activates the window and displays it as a minimized window. 
3   Activates the window and displays it as a maximized window. 
4   Displays a window in its most recent size and position.
     The active window remains active.
5   Activates the window and displays it in its current size and position.
6   Minimizes the specified window and activates the next top-level window in the Z order.
7   Displays the window as a minimized window. The active window remains active.
8   Displays the window in its current state. The active window remains active.
9   Activates and displays the window.
    If the window is minimized or maximized, the system restores it to its original size and position.
     An application should specify this flag when restoring a minimized window.
10  Sets the show-state based on the state of the program that started the application.

- bWaitOnReturn : Optional. Boolean Value(True / False, default is False)
명령줄에 의한 프로그램 실행이 완료될 때까지 기다릴 것인지 여부.
기본값은 False 이며, 생략시 해당 명령줄에 의한 프로그램 실행 여부와 상관없이
자동으로 0을 반환하고, 다음 스크립트가 계속 진행된다. (cf, 에러코드가 아닌 0을 반환)
cf, SendKey 메소드 등과 같이 쓸 때 True(기다림) 옵션을 적용해도 다음 스크립트가
    계속 진행된다. (SendKeys 에서의 순차실행 트릭 - 아래 Do While문 참조..)

WshShell.Run "%windir%\notepad" & WScript.ScriptFullName
intError = WshShell.Run("notepad " & WScript.ScriptFullName, 1, True)

Dim WshShell : Set WshShell = WScript.CreateObject ("WScript.Shell")
Dim oExec : Set oExec = WshShell.Exec("calc")

' 순차 실행 트릭 (Do While 문으로 Status 가 0 일 경우,
' = 프로그램 실행중 일 경우 Sleep으로 계속 창이 떠 있게 한다.)
Do While oExec.Status = 0
     WScript.Sleep 100
Loop

WScript.Echo oExec.Status
'  Status =  0  : The job is still running.
'  Status =  1  : The job has completed.


* 비교 : Run 과 Exec
'=> Run 은 실행만 하지만, Exec는 실행과 동시에 개체(object)를 생성한다.
'    따라서 Exec를 통한 실행은 생성된 개체를 이용한 후속 작업이 용이하다.

Set WshShell = Wscript.CreateObject("Wscript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
TempName = FSO.GetTempName
TempFile = TempName

WshShell.Run "cmd /c ping -n 3 -w 1000 157.59.0.1 >" & TempFile, 0, True
Set TextFile = FSO.OpenTextFile(TempFile, 1)
Do While TextFile.AtEndOfStream <> True
    strText = TextFile.ReadLine
    If Instr(strText, "Reply") > 0 Then
        Wscript.Echo "Reply received."
        Exit Do
    End If
Loop

TextFile.Close
FSO.DeleteFile(TempFile)


' 아래는 동일한 결과는 가지는 Exec 를 통한 실행이다.
' 실행을 통해 반환되는 StdOut 에 접근하기위해 임시파일 만들고 할 필요가 없다.

Dim WshShell : Set WshShell = WScript.CreateObject("WScript.Shell")
Dim ExecObject : Set ExecObject = WshShell.Exec ("cmd /c ping -n 3 -w 1000 157.59.0.1")
Do While Not ExecObject.StdOut.AtEndOfStream
    strText = ExecObject.StdOut.ReadLine
Loop

AND