Forum Discussion
Pakema
15 years agoContributor
To start add in project TestedApp module
Than On VBS:
Sub CallRunApp
'Run notepad without parametrs
Call RunApp("C:\WINDOWS\notepad.exe", "")
End Sub
'
'RunApp
'
'Run application via TestedApp module
'
'Input variable
'- FileName - full path to executable file
'- locParams - parameters for launch executable file
'
'Return value:
'-none
'
Sub RunApp(FileName, locParams)
'Declare variable
Dim AppIndex, myApp
'Add our application in TC - get index in TestedApps module
AppIndex = TestedApps.Add(Trim(FileName))
'Get pointer for this application by index
Set myApp = TestedApps.Items(AppIndex)
'Check - whether to run with parameters
If Trim(locParams) <> "" Then myApp.Params.SimpleParams.CommandLineParameters = Trim(locParams)
'Run our App
myApp.Run
'clear variable
Set myApp = Nothing
End Sub ' RunApp