How to elevate Perl process using UAC

前端 未结 3 1011
野趣味
野趣味 2021-01-20 17:24

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

3条回答
  •  一生所求
    2021-01-20 17:37

    If you're ok with launching through a shortcut, you can use the following:

    1. Create a shortcut to perl.exe
    2. Edit the shortcut.

      1. On the Shortcut tab, change "Target" to

        "c:...\bin\perl.exe" "c:...\script.pl"

      2. [Optional] On the Shortcut tab, change "Start in" to the path of the directory in which your script resides.

      3. On the Shortcut tab, click "Advanced", then check "Run as Administrator".

    There's a tool called "runas", but I can't seem to get it to work without asking you for Administrator's password.

提交回复
热议问题