如何使用UAC提升Perl流程 [英] How to elevate Perl process using UAC

查看:99
本文介绍了如何使用UAC提升Perl流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个脚本,该脚本需要从不允许普通用户读取的位置(例如,其他用户的文件夹)中读取信息.

Suppose I have a script that needs to read information from places that normal user is not permitted to read (e.g. other users' folders).

当前,我所能做的就是抱怨没有以超级用户"身份运行并退出,但是我希望脚本本身来请求提升.

Currently all I can do is complain about not being run as a "superuser" and quit, but I would rather like the script to ask for elevation itself.

推荐答案

根据 PerlMonks ,您可以尝试:

According to MSDN and PerlMonks, you can try:

Win32::FileOp::ShellExecute( runas => 'yourprogram.exe' )

Win32::FileOp::ShellExecute( runasuser => 'yourprogram.exe' )

这些(未经测试)应在需要时要求您升高. (仅适用于Windows 7).

These should (not tested) ask you for elevation when it is needed. (Works on Windows 7 only).

相关:在运行时请求管理员特权

这篇关于如何使用UAC提升Perl流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆