how to give administrator access to a application in windows 10 without administrator popup

AshishUparaEpsilon

New Member
Joined
Jun 19, 2023
Messages
2
Hi,


I need to change the system time using a Qt application. I have a specific function in Qt Creator that handles this task. However, changing the time requires administrative privileges for the application. The issue is that this application is running on a Single Board Computer (SBC) and it runs on autostart when the SBC boots up. Therefore, it is not feasible to manually press the "Yes" button for administrative permission every time.


Does anyone have any idea how to avoid this issue?


Thanks and regards,
Ashish Upara
 
Solution
Hello Ashish Upara,
To avoid the issue of the "Yes" button for administrative permission every time the application runs, you can give your application administrator access without the popup. Here are some ways to achieve this:
1. Using a Manifest File: You can create a manifest file that specifies administrative privileges for your application, using the UAC Execution Level attribute. The manifest file can be embedded into your application by adding the resource file to the project in Qt Creator.
2. Editing Registry: You can edit the registry to disable the User Account Control (UAC) prompt every time your application is run. However, this might not be the safest option as it disables a security feature of Windows.
3. Using RunAs...
Hello Ashish Upara,
To avoid the issue of the "Yes" button for administrative permission every time the application runs, you can give your application administrator access without the popup. Here are some ways to achieve this:
1. Using a Manifest File: You can create a manifest file that specifies administrative privileges for your application, using the UAC Execution Level attribute. The manifest file can be embedded into your application by adding the resource file to the project in Qt Creator.
2. Editing Registry: You can edit the registry to disable the User Account Control (UAC) prompt every time your application is run. However, this might not be the safest option as it disables a security feature of Windows.
3. Using RunAs /savecred: You can use the "RunAs" command to create a shortcut that will run your application as an administrator without the UAC prompt. However, this method could lead to security issues as the saved credentials can be accessed by other users on the same machine.
It is recommended to use the first method (using a manifest file) which is the safest and most reliable approach. You can find more information on how to create a manifest file in the Qt Creator documentation.
I hope this helps you solve your issue!
 
Solution