0

I see many threads here about how can a software be programmed to ask for administrator privileges on Windows, but in my case I have a software installer that runs with administrator privileges and, in the end of installation, it must execute another process with limited privileges (as the logged user). Both installer and installed softwares was created by me using Delphi.

I am researching about this subject for all day long and it seems to be a very difficult task to achieve by programm language only. My question is if there is some Windows command that I can use to "call" the executable with lower privileges or maybe a manifest configuration that I can incorporate to the installed software to avoid it runs with admin privileges. Well, any ideas are welcome!

Thank you!

Guybrush
  • 161

1 Answers1

2

I tried all the solutions pointed in the similar question, without success. My workaround was to use the schtasks command inside a BAT file to schedule a Windows task, run and delete it in the sequence.

First I create a task manually using the Task Scheduler and exported it to a XML file (right-click > Export).

enter image description here

After I created a BAT file to do the job based on the XML file:

schtasks /create /tn "TempTask" /xml "c:\temp.xml"
schtasks /run /tn "TempTask"
schtasks /delete /f /tn "TempTask"

Hope it helps other people with same issue! Thanks!

Guybrush
  • 161