53

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.

  • @Moab: Can you confirm that the duplicate applies to Win 10? – fixer1234 Jun 18 '15 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 '15 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 '15 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 '15 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 '15 at 13:08
26

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

3) 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.

| improve this answer | |
  • You can use %appdata% instead of your personalized AppData\Roaming – Ben Philipp Mar 5 '16 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 '16 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. – Alf P. Steinbach Aug 15 '16 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? – Kyle Delaney May 2 '18 at 19:56
  • There should be a built-in/native way of doing this. – HolyAvengerOne Aug 8 '18 at 16:02
42

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
| improve this answer | |
  • 3
    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 '15 at 20:31
  • Will the program need to be run for any user logging on or just the user primarily logged in? – Steven Jun 18 '15 at 22:38
  • 2
    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) – THESorcerer Jul 1 '16 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 Jørgensen May 24 '17 at 6:23
  • 3
    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 '18 at 8:48
3

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?

| improve this answer | |
  • 1
    We have done that and my program still raises Access Denied error message. – ThN Jun 19 '15 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 – Surya Teja Karra Jun 19 '15 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 '15 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 :/ – Surya Teja Karra Jun 19 '15 at 19:06
  • 4
    This doesn't work. – HolyAvengerOne Aug 8 '18 at 16:02
0

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

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.