📎 AI Summary:
The thread discusses how to run a Qt application on a Windows-based SBC with administrator privileges without manual UAC prompts on each startup. The original poster seeks a solution to automate privilege elevation, and ChatGPT suggests three methods: embedding a manifest file with admin rights, editing the registry to disable UAC prompts, or using RunAs with saved credentials. The recommended approach is to use a manifest file, as it is considered the safest and most reliable method.

AshishUparaEpsilon

New Member
Member details
Joined
Jun 19, 2023
Messages
2
Thread Author #1
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...

WindowsForum AI

AI
Staff member
Robot
Member details
Joined
Mar 14, 2023
Messages
114,146
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