How to run a program normally with admin privilleges not as a background process using Task Scheduler?

0

I have looked through other questions in superuser and online and they all seem to suggest using Task Scheduler for what I want to do. Simply, I want to run my program at STARTUP or Boot with admin privileges. So far, I am not able to do it successfully. I have marked my exe file to run as administrator and have placed a link in the startup folder. It starts my program without admin privilege. Task scheduler seemed to be promising, but it is only starting my program as a background process and I can see my program listed under background process but my program main window doesn't load.

I followed what someone suggested using Task Scheduler as follows:

Create a Scheduled Task. Rather than triggering at a specific time, you trigger it at startup.

In the "Create Task" dialog, select the following:

General (tab) - "Run with highest privileges"
Triggers (tab) - New (button) - Begin the task - "At startup"

Note: Depending on the program "at log on" may be more applicable than "at startup."

ThN

Posted 2015-06-18T13:52:21.263

Reputation: 827

Are you loading the main program with any parameters? – Dave – 2015-06-18T13:56:54.573

@Dave Nope... What parameters do I need to run my program as an application? – ThN – 2015-06-18T14:00:15.180

You don't, I just wanted to make sure you weren't. – Dave – 2015-06-18T14:03:19.150

the task scheduler trick only works for admin accounts. Looks like you use a standard user account – magicandre1981 – 2015-06-18T17:20:03.870

@magicandre1981 So, even though we have an account identified as administrator and with administrator privileges, it is not good enough.... – ThN – 2015-06-18T17:37:14.413

if it is an admin account it should work. are you logging into this admin account or into a different one? – magicandre1981 – 2015-06-19T04:03:10.137

@magicandre1981 When the system boots up, it logs into Administrator's account and we verified that it is. So, I am not sure what is going on... Maybe I need to give my software full permission??? Or maybe this is a bug in Windows 10... We are using the Windows 10 test or Beta Version. I don't know if that has anything to do with it. – ThN – 2015-06-19T12:29:58.493

I've just tested it under Windows 10 and it works fine with a trigger at logon. – magicandre1981 – 2015-06-19T17:29:33.287

Answers

0

Have a look at runas:

https://stackoverflow.com/questions/8249705/how-to-run-an-application-as-run-as-administrator-from-the-command-prompt

Make sure that the runas command has the /savecred switch. It'll ask you for credentials once and store them for future use.

Place a batch file with your command in your autostart folder.

megamorf

Posted 2015-06-18T13:52:21.263

Reputation: 1 494

I did do that and at startup it popups a cmd prompt for administrator's pass. When I enter it, it goes away but then I don't see my application running. I looked in the Task Manager and see that it did start but only as background process not as an application like before. We even tried it on some simple and small program thinking there may something wrong with my program to see if it acts the same and it does. – ThN – 2015-06-19T13:06:39.700