Forum Discussion

romanmfs's avatar
romanmfs
Frequent Contributor
8 years ago

Task Scheduler Fails - Requested Operation Requires Elevation (0x800702E4).

Task Scheduler Fails - Requested Operation Requires Elevation (0x800702E4).

 

We have a Windows virtual machine set up (Windows 10 Pro intstalled) , and I have administrator privileges on it. I am trying to schedule a test and it fails with the error stated above. 

 

Task scheduler runs fine on my machine only fails on server. 

I tried all possible variations to run it (as administrator, from a different user, different machine, highlighting "highest privileges", using different configurations: for server 2003, for windows 10 etc).

  • A couple of things - 

     

    We can't really see what task you're trying to schedule - are you just launching TestComplete?

     

    Can you run TestComplete from this machine without using the scheduler?  If not, what happens when you try?

    • romanmfs's avatar
      romanmfs
      Frequent Contributor

      Scheduling just the launch.

      I can run testcomplete w/o using a scheduler no problem. 

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        My best guess....You're telling it to run as a particular user even if that user is not logged in but you're not telling it to store the password.  I'm guessing that it cannot "authorize" this functionality without having the user password.  

         

        Try changing it to run only when the user is logged in... in fact, this is probably the best practice because you HAVE to have a logged in session with the desktop UI available in order to run TestComplete tests.  See if that works.

  • dennis1's avatar
    dennis1
    Occasional Contributor

    Has someone figured this out yet?

     

    On one pc it works perfectly fine, and when i tried to implement the same function on another pc it gave me this error.

     

    opening TestExecute works when I do it manually, but when calling the TestExecute.exe file from task scheduler it throws this error. That doesn't make sence... right?

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      It really comes down to a permissions problem.  The user under which the windows task is running does not have sufficient permissions to do what it needs to do.  Please make sure that you have your scheduled user set up properly with the correct permissions and that the task is set to run with elevated permissions.

    • cneedham's avatar
      cneedham
      Occasional Contributor

      You can run as elevated. 

       

      Basically you need to run as admin via the command line. 

       

      Here's an example. The easy way to do this is to create two batch files. 

      1. Batch file launches the other one as elevated. 

      Here's the launcher batch file: 

       

      Create this file

      runTcAsAdmin.bat  (you will schedule this file in your scheduled task) 

       

      Put this text in the file

      powershell -Command  Start-Process launchTest -Verb RunAs

       

       

      Create this file: 

      launchTest.bat

       

      Put this text in the file: 

       

      "C:\Program Files (x86)\SmartBear\TestExecute 12\Bin\TestExecute.exe" /exit /run /SilentMode /ErrorLog:tcErrors.txt C:\projectFolder\projectName.pjs

       

       

      That should run your test as an administrator. 

       

      If you get an error with powershell, you need to do this: 

       

      https://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this-system