i am trying to do this for the first time. normally i don't try to schedule a testcomplete automation script to run on a VM using the task scheduler but i would like to figure out how its done. i have been at this all day trying one thing and then another but nothing works. it should be noted however that the project/testitem does run successfully if i manually kick it off so there's nothing wrong with the script, per se. this is essentially it
"C:\Program Files (x86)\SmartBear\TestExecute 15\x64\Bin\TestExecute.exe" -ArgumentList "/exit /run <full qualified path>\<project suite>.pjs /p:<project name> /t:ProjectTestItem1"
First, i attempted the simple approach and just configured the Edit Actions of the scheduled task to start the testexecute application and put the command line arguments in the Add arguments box. that resulted in a Run Result message of "the request operation requires elevation"
Next, i created a powershell file called runTcAsAdmin.ps1 containing a single line with a "Start-Process -FilePath" appended to the front of the call to TestExecute followed by its list of command line arguments. I put powershell.exe in the program/script box of the task scheduler and put the following powershell arguments in the Add arguments box
-Command Start-Process PowerShell -ArgumentList '-File <fully qualified path name>\runTcAsAdmin.ps1' -Verb RunAs
That one finished with "The operation completed successfully" in the Run Result message but it didn't do anything that the automation script was designed to do.
Finally, i tried creating a bat file called runTcAsAdmin.bat with the following contents and in the same location as the runTcAsAdmin.ps1 file and i changed the Task Scheduler Action so that it points to this bat file
Echo OFF
PowerShell.exe -NoProfile -Command "& {Start-Process PowerShell.exe -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%~dpn0.ps1""' -Verb RunAs}"
but that had the same result as the previous attempt. Does anyone have something working for this? what step or parameter am i missing?