简体   繁体   中英

Windows Administrator Registry

I'm writing an start up application on windows. My app requires administrator privileges. So I request it by UAC promt. But when the user reset's the pc the UAC yes/no pops up to screen. I don't want to turn off the UAC. I think I can register my application as always administrator by regedit. Where is this key? thanks

We can create a shortcut for this application with elevated privileges.

  1. Click Start, right click on Computer and choose “Manage”.
  2. Click “Task Scheduler” on the left panel.
  3. Click “Create Task” on the right panel.
  4. Type a name for the task.
  5. Check “Run with highest privileges”.
  6. Click Actions tab.
  7. Click “New…”.
  8. Browse to the program in the “Program/script” box. Click OK.
  9. On desktop, right click, choose New and click “Shortcut”.
  10. In the box type: schtasks.exe /run /tn TaskName where TaskName is the name of task you put in on the basics tab and click next.
  11. Type a name for the shortcut and click Finish. Now, you can double click the shortcut to run the program, and the UAC window will not prompt.

The user has to elevate via the UAC consent dialog every time the program starts. There is no way around that. The registry setting that you are hoping for does not exist. If it did, that would defeat the purpose of UAC.

You should arrange that you application does not require admin rights if at all possible. Or move the parts of the application that do require admin rights into a separate process that is only started when needed.

Another possibility would be to put the part of your application that requires admin rights into a service, and run a standard user application on the interactive desktop at logon. You can then use an IPC method of your choice to communicate between the two processes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM