Leia Executar o método (host de scripts do Windows) ;
Runs a program in a new process.
Syntax
object.Run(strCommand, [intWindowStyle], [bWaitOnReturn])
Arguments
object
- WshShell object.strCommand
- String value indicating the command line you want to run. You must include any parameters you want to pass to the executable file.intWindowStyle
- Optional. Integer value indicating the appearance of the program's window. Note that not all programs make use of this information.bWaitOnReturn
- Optional. Boolean value indicating whether the script should wait for the program to finish executing before continuing to the next statement in your script. If set to true, script execution halts until the program finishes, andRun
returns any error code returned by the program. If set to false (the default), theRun
method returns immediately after starting the program, automatically returning0
(not to be interpreted as an error code).
O próximo snippet de código pode funcionar para você:
retValue = createobject("wscript.shell").run ( _
"Rasdial connection_name account_name password",0 , True)
If retValue <> 0 then
MsgBox "There is no available connection."
End If