如何从命令行以管理员身份运行应用程序 (TestComplete)

发布于 2024-09-10 02:45:16 字数 316 浏览 2 评论 0原文

场景....

我正在编写一个 powershell 脚本来自动化一些 UI 测试,我必须做很多事情,从存储库中检查代码,构建,复制安装程序,然后最后我想运行TestComplete 并测试安装程序 UI...

安装程序在写入程序文件、注册表等时以提升模式运行,因此,为了让 TestComplete 中的测试脚本看到 msiexec 进程,TestComplete 也需要提升运行。我如何从命令行执行此操作?我似乎无法使用 runas 来执行此操作,1/它只是以用户(具有管理员权限)的身份运行应用程序,但实际上并未提升权限,2/我无法在脚本中提供密码。

有什么想法吗?

Scenario....

I am writing a powershell scrip to Automate some UI Testing, there are a bunch of things that I have to do re, checking code out of a repository, building, copying installers, then at the end I want to run TestComplete and test the installer UI...

The Installer runs in elevated mode as it writes to program files, registry etc so, in order for my test script in TestComplete to see the msiexec process, TestComplete also needs to be run elevated. How do I do this from the command line? It does not appear that I can do this with runas, 1/ it just runs the app as the user (who has admin privileges) but not actually elevated and 2/ I can't supply a password in the script.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一笑百媚生 2024-09-17 02:45:16

您可以使用 Start-Process cmdlet 运行脚本 elevatd,如下所示:

Start-Process <some_exe> -Verb runas

You can run a script elevatd by using the Start-Process cmdlet like so:

Start-Process <some_exe> -Verb runas
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文