How to run the application (TestComplete) as an administrator from the command line

Scenario....

I am writing a powershell script to automate some user interface tests, there are many things that I have to do by checking the code from the repository, creating, copying the installers, and then in the end I want to run TestComplete and check the installer user interface ...

The installer works in elevated mode when writing to program files, registry, etc., therefore, to check my test script in TestComplete, to see the msiexec process, TestComplete should also be raised. How to do it from the command line? It doesn't seem like I can do this with runas, 1 / it just launches the application as a user (which has administrator rights), but is not actually promoted, and 2 / I cannot provide a password in the script.

Any ideas?

+3
source share
1 answer

You can run the elevatd script using the Start-Process cmdlet as follows:

Start-Process <some_exe> -Verb runas
+4
source

Source: https://habr.com/ru/post/1755250/


All Articles