75

We have a program that is having problem starting up on Windows 10. If the program is NOT run as administrator, it popups a "Access Denied" message right before it starts. If we run the program as an administrator, it does NOT popup any error message and loads normally. However, now the program won't run at STARTUP. So, we need to run our program as administrator and be able to automatically run the program at startup.

Update: Even though my question and the duplicate question maybe the same but the answers provided for both questions did not solve my problem. Task Scheduler only starts my application or program as a background process. Thus, my program doesn't load. However, I do see my process in the task manager under background process. That's all.

7
  • @Moab: Can you confirm that the duplicate applies to Win 10?
    – fixer1234
    Jun 18, 2015 at 2:52
  • @Ramhound Yes it does, but task scheduler does not start my program normally but as a background process. That's not what I am looking for. Am I missing something?
    – ThN
    Jun 18, 2015 at 12:34
  • @fixer1234 if you are specifically talking about my question and the question marked as a duplicate, then no. My question is related to Windows 10 and the duplicate is related Windows 7.
    – ThN
    Jun 18, 2015 at 12:36
  • @Ramhound You are right, but one question is specifically asking for Windows 10 solution and the other one is for Windows 7 even though both solutions apply windows 10.
    – ThN
    Jun 18, 2015 at 12:56
  • @Ramhound Yes, you are right. You asked how my question and the duplicate question are different. I told you other than Windows versions, they are both the same. you can go ahead and mark my question as duplicate if you want.
    – ThN
    Jun 18, 2015 at 13:08

4 Answers 4

33

This is a little old, but I was having the same problems, and none of the above was working. What I did was create a VBScript that ran at startup that opened said program.

  1. Right-click on the program, go to properties, then compatibility and check "Run as Administrator"

  2. Create the VBScript using a text editor (I use Notepad++)

Script:

Set WshShell = CreateObject("WScript.Shell" ) 
WshShell.Run """C:\Program Files (x86)\File\Program.exe""", 0 'Must quote command if it has spaces; must escape quotes
Set WshShell = Nothing

Note: that C:\Program Files (x86)\File\Program.exe is the full path to the program with extension. Also, make sure to save it as a .vbs

  1. Now place the VBScript in the startup folder:

    %AppData%\Microsoft\Windows\Start Menu\Programs\Startup

Or, alternatively access it by Win+Rshell:startupEnter

I used this instead of a batch file because I did not want that ugly command window showing up.

11
  • You can use %appdata% instead of your personalized AppData\Roaming Mar 5, 2016 at 15:32
  • This is exactly what I end up doing, but I used Delphi to write a mini program which will call my program at startup. This mini program ran at startup. This workaround did the job.
    – ThN
    Mar 6, 2016 at 0:13
  • I found that that to invoke an elevated shortcut so that it ran as elevated, I had to let the script start cmd.exe with /c option to run the shortcut. Aug 15, 2016 at 14:43
  • To be clear, this still prompts the user to say if they want to run the program as administrator, right? This startup trick doesn't bypass that somehow, right? May 2, 2018 at 19:56
  • 1
    There should be a built-in/native way of doing this.
    – Oli
    Aug 8, 2018 at 16:02
77

Create a Scheduled Task to trigger at log on.

In the Create Task dialog, select the following:

  1. General (tab), Run with highest privileges
  2. Triggers (tab), New (button), Begin the task, At log on
10
  • 6
    I did follow your answer but it starts the program as a background process not as an application. As a result, nothing loads in the screen and the process is listed under background process in the Task Manager.
    – ThN
    Jun 17, 2015 at 20:31
  • 1
    The user that logins in when the system boots up is Admin with full privileges. I learned from other superuser question that Task Scheduler by default runs program only as NON-Admin-privileged. Thus, the program runs as background process even though "run with highest privileges" checkbox is checked.
    – ThN
    Jun 19, 2015 at 12:55
  • 3
    this is actually an A LOT better answer than the previous, be cause you can program a daemon to start when computer start and no user is logged on, for example I need to start deluged at computer start even me or any1 else will log on on that computer (deluge is a torrent client, which in non classic mode will become client/server, therefore I don't need client started to have the server running), the only other solution but this is to have it started by another service (like cygwin's cron) or to make it a service (and to do that manually if the software makers didn't design it like this) Jul 1, 2016 at 8:11
  • 1
    @ThN You can try to add a small delay, 10-15 seconds, to the trigger. That fixed the "running in the background" for me. That was for a AutoHotkey script, don't know if it applies to your problem.
    – Anders
    May 24, 2017 at 6:23
  • 7
    At first it was not working for me either, but only because I had set the trigger to "At startup" which is wrong because my program is not a service, it's an application with a user interface. Instead, I had to set the trigger to "At logon" and select MY windows user. It worked right away after that!
    – Nicolas C.
    Aug 22, 2018 at 8:48
2

Well why don't you simply copy the shortcut of the program to the Startup folder and on its properties, enable the administrator permissions on the Compatibility tab?

5
  • 2
    We have done that and my program still raises Access Denied error message.
    – ThN
    Jun 19, 2015 at 18:54
  • did you right click the shortcut in the Startup folder and set it's permissions properly? The "Run as administrator" option is usually present in the Compatibility tab of the properties window Jun 19, 2015 at 18:56
  • 1
    You are right. First, we have enabled Run with highest privilege checkbox in the compatibility section for the shortcut. Then, clicked on the icon, it still popped the error message. Then, we moved the shortcut into startup folder, it still raised the error message. We even tried Task Scheduler and still the same. I even tried batch file in the task scheduler like someone suggested. it the same. The only time it loads normally is when we right click on the actual executable file for my program and click on Run as an Administrator option in the popup menu. The only user is the admin in sys
    – ThN
    Jun 19, 2015 at 19:03
  • You know back in the days, XP had this "Run as" context menu with which I could run a program as another user had I got the authorization to do so. Maybe this program of yours needs the same thing :/ Jun 19, 2015 at 19:06
  • 8
    This doesn't work.
    – Oli
    Aug 8, 2018 at 16:02
-1

You can try double checking your Security tab in the Properties of the program/app and see if the users/groups all have "Full Control". Im not sure if that will fix but its worth a try

1
  • 6
    This doesn't work.
    – Oli
    Aug 8, 2018 at 16:02

Not the answer you're looking for? Browse other questions tagged .