Forum Discussion

kandy1984's avatar
kandy1984
Contributor
7 years ago

Running batch file as admin from Test Complete

Hi, I have a batch file which needs to be run as adminstrator. This batch file contains scripts to start and stop a service and windows 10 only lets it to be executed as administrator. How can i ru...
  • tristaanogre's avatar
    7 years ago

    If you have the option, you could always run TestComplete as an administrator.  I don't know if this is a security/policy issue for you.  When you do so, then anything you execute within TestComplete is run with that privilege level.  

    That said, rather than using a batch file, you could always use the WshShell Object to execute a command line to start/stop as service.  This is what I've used in the past and is much easier to keep track of than the location and contents of batch files.  See https://support.smartbear.com/testcomplete/docs/reference/program-objects/wshshell/index.html