Lisp HUG Maillist Archive

How should I change privilege level?

I wrote a  utility in LispWorks for Windows. It needs to run in Administrator level. Is there a way to up the privilege level inside the Lisp utility? Or would I use foreign functions to call Windows C Language functions? Or is there a way to compile the executable that will run itself in Administrator privilege level?

 

Ron Lewis

Baltimore, MD 21215-3551

USA

 

 

Re: How should I change privilege level?

In Windows there is no way to escalate a running process' privilege level: It is determined upon launching.
Here's a couple of options:
1. The use should be able to execute the application as Administrator by right-clicking and running as administrator there.
2. Create a shortcut to the executable. In the 'Advanced' properties of the shortcut there is an option to run as administrator
3. In the Compatibility options of the executable, there's an option for 'Run As Administrator'.

If launching on the command-line, you can use the `runas` command, though I've never figured out how to portably get at the administrator user

On Sun, May 26, 2019 at 9:33 AM Ron Lewis <rlewis-4d@indinfer.com> wrote:

I wrote a  utility in LispWorks for Windows. It needs to run in Administrator level. Is there a way to up the privilege level inside the Lisp utility? Or would I use foreign functions to call Windows C Language functions? Or is there a way to compile the executable that will run itself in Administrator privilege level?

 

Ron Lewis

Baltimore, MD 21215-3551

USA

 

 



--
Wilfredo Velázquez-Rodríguez

Re: How should I change privilege level?



On 26 May 2019, at 15:42, Wilfredo Velazquez <zulu.inuoe@gmail.com> wrote:

In Windows there is no way to escalate a running process' privilege level: It is determined upon launching.
Here's a couple of options:
1. The use should be able to execute the application as Administrator by right-clicking and running as administrator there.
2. Create a shortcut to the executable. In the 'Advanced' properties of the shortcut there is an option to run as administrator
3. In the Compatibility options of the executable, there's an option for 'Run As Administrator'.

If launching on the command-line, you can use the `runas` command, though I've never figured out how to portably get at the administrator user

The perhaps it would be possible to run runas from the lisp program, to relaunch it as Administrator, when it is not already running at this privilege level?
Or to do the equivalent with a MS-Windows API, if it exists?

-- 
__Pascal J. Bourguignon__




Updated at: 2020-12-10 08:29 UTC