The following VBScript works for me:
Enter the following code in VBScript editor and save teh file(saves as a VBS file) then you can go to the CMD to run the VBS file or use windows scheduler to schedule for a particular time.This is just an example make sure to change the location of the test script.
'**************************************************************************
'The following script opens a test, configures run options and settings,
'runs the test, and then checks the results of the test run.
'**************************************************************************
Code:
Dim qtApp 'As QuickTest.Application 'Declare the Application object variable
Dim qtTest 'As QuickTest.Test 'Declare a Test object variable
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
Const ForReading = 1, ForWriting = 2
Dim fso, f, result
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("C:\Program Files\Mercury Interactive\QuickTest Professional\Tests\Regression_Test_Results.txt", ForWriting, True)
Set qtApp = CreateObject("QuickTest.Application") 'Create the Application object
qtApp.Launch 'Start QuickTest
qtApp.Visible = True 'Make the QuickTest application visible
'Set QuickTest run options
qtApp.Options.Run.ImageCaptureForTestResults = "OnError"
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False
qtApp.Open "C:\Program Files\Mercury Interactive\QuickTest Professional\Tests\Regression_Suite_BA_1\CharitableOrg_Owner_NonQual_GuaDeathBenefit_SurrenderCharges", True ' Open the test in read-only mode
'Set run settings for the test
Set qtTest = qtApp.Test
qtTest.Settings.Run.IterationMode = "rngIterations" 'Run only iterations 2 to 4
qtTest.Settings.Run.StartIteration = 2
qtTest.Settings.Run.EndIteration = 4
qtTest.Settings.Run.OnError = "NextStep" ' Instruct QuickTest to perform next step when error occurs
'Set the results path
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "C:\Program Files\Mercury Interactive\QuickTest Professional\Tests\Regression_Suite_BA_1\CharitableOrg_Owner_NonQual_GuaDeathBenefit_SurrenderCharges\Res1" ' Set the results location
qtTest.Run qtResultsOpt 'Run the test
result= qtTest.LastRunResults.Status
f.Write("Test 1: CharitableOrg_Owner_NonQual_GuaDeathBenefit_SurrenderCharges - ")
f.Write(result)
f.WriteBlankLines(1)