[This is preliminary documentation and subject to change.]
The Run method creates a new process which executes strCommand with window style intWindowStyle.
WshShell.Run (strCommand, [intWindowStype], [bWaitOnReturn])
If bWaitOnReturn is set to TRUE, the Run method returns any error code returned by the application. If bWaitOnReturn is not specified or is FALSE, Run returns an error code of 0 (zero).
' This fragment launches Notepad with the current executed script
Set WshShell = Wscript.CreateObject("Wscript.Shell")
WshShell.Run ("notepad " & Wscript.ScriptFullName)
WshShell.Run ("%windir%\notepad" & Wscript.ScriptFullName)
' This fragment returns the error code from the executed application
Return = WshShell.Run("notepad " & Wscript.ScriptFullName, 1, TRUE)
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.