My usecase

Some of my RGB devices require OpenRGB to be run with elevated privileges. This is where I started running into some problems:

Existing methods

Running OpenRGB as a Windows Service

While this works, there are some problems with it:

  • Applying profiles at startup can be a pain and sometimes doesn’t work for no reason
  • Restarting OpenRGB is more annoying
  • Still forces you to run a user instance of OpenRGB to change anything
  • The Service runs as the SYSTEM user which
    • Is a terrible security practice
    • Breaks some other RGB connections which get initialized later in the boot process

Setting the Shortcut to run as Administrator

Also technically works but shows you a UAC prompt on every startup which is incredibly annoying.

The fix

Creating a Windows Task Scheduler Task that runs on login works perfectly, here’s how to do it:

Warning This guide assumes you are using the installer version of OpenRGB. If you are using the portable version, change your paths accordingly

Instructions

  • Start OpenRGB with administrative rights and set up your devices
  • Click Save Profile and choose a name. I used default

Run this code snippet in an elevated (admin) PowerShell window:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
$action    = New-ScheduledTaskAction `
                 -Execute          "C:\Program Files\OpenRGB\OpenRGB.exe" `
                 -Argument         "--gui --startminimized --profile default.orp"`
                 -WorkingDirectory "$env:APPDATA\OpenRGB"

$trigger   = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME

$principal = New-ScheduledTaskPrincipal -UserId $env:USERNAME -RunLevel Highest

$settings  = New-ScheduledTaskSettingsSet `
                 -ExecutionTimeLimit ([TimeSpan]::Zero) `
                 -Compatibility      Win8

$settings.DisallowStartIfOnBatteries = $false

Register-ScheduledTask -TaskName "OpenRGB" -Action $action -Trigger $trigger -Principal $principal -Settings $settings
Info If you prefer not running random code you found on the Internet, here’s how to do it manually
  • Open Windows Task Scheduler (taskschd.msc)
  • Under Actions click Create Basic Task
  • Under Name enter OpenRGB
  • Set the Trigger to When I log on
  • Set the Action to Start a Program
  • Under Program/Script enter C:\Program Files\OpenRGB\OpenRGB.exe
  • Under Add Arguments enter --gui --startminimized --profile default.orp (replace default with your profile name if you went with another one)
  • Under Start in enter `%APPDATA%\OpenRGB
  • Select Open the Properties dialog for this task when I click Finish
  • Check Run with highest privileges
  • Under Configure for select Windows 10
  • On the Conditions tab uncheck Start the Task only if the computer is on AC power
  • On the Settings tab uncheck Stop the task if it runs longer than: x days
  • Click OK

Now OpenRGB will run with the needed permissions and be right there in your TaskBar in case you need it :)