Windows 10: How to set up elevated process to run at user logon?

Page 1 of 2 12 LastLast

  1. Posts : 63
    Xp, Vista, 7, 8.1, 10
       22 Mar 2017 #1

    How to set up elevated process to run at user logon?


    Let me explain my dilemma. We have this custom-made executable that interfaces with our hardware in the shop that needs to run as soon as someone logs in to this workstation. The way it was programmed, it needs to run elevated:

    Click image for larger version. 

Name:	0.PNG 
Views:	30 
Size:	7.5 KB 
ID:	126301


    So I'm trying to automate the process of running it as soon as Windows user enters the password and logs in. (It causes problems when some employees forget to run this file upon login, which is easy to do.)There are two user accounts set up on this machine:Admin (Administrator) with a passwordDc (Standard user) with a passwordThe account in question that I need to automate the login for is Dc.So I went to Task Scheduler, ran it as Admin account and set up a task to run with Admin (highest) privileges:

    Click image for larger version. 

Name:	1.PNG 
Views:	29 
Size:	20.2 KB 
ID:	126302

    do it at logon only, for the Dc account:

    Click image for larger version. 

Name:	2.PNG 
Views:	29 
Size:	41.4 KB 
ID:	126303

    to run our elevated file:

    Click image for larger version. 

Name:	3.PNG 
Views:	29 
Size:	27.9 KB 
ID:	126304

    with these conditions:

    Click image for larger version. 

Name:	4.PNG 
Views:	30 
Size:	19.2 KB 
ID:	126305

    and these settings:

    Click image for larger version. 

Name:	5.PNG 
Views:	29 
Size:	19.1 KB 
ID:	126306

    So I OKed the task and rebooted computer. I then logged in under Dc account, and nothing happened.I then started the Task Scheduler, and checked the task history. This is what it showed:


    Click image for larger version. 

Name:	6.PNG 
Views:	4 
Size:	34.5 KB 
ID:	126307


    The question I have, is why does it say "because user Admin was not logged on" when I clearly indicated "Specific user: Dc" in the screenshot above?
      My ComputerSystem Spec


  2. Posts : 32,544
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       22 Mar 2017 #2

    Wild guess.....

    In order for the user DC to run that .exe with Admin privileges, it may be trying to run the .exe "As Administrator", similar to right clicking a .exe and choosing Run As Administrator. Since Administrator is not logged on, there are no inherited privileges yet. I'm probably not saying all this quite right, but it may be a timing issue getting the privileges from an internal account (Admin) that has not fully initialized.

    Like I said....wild guess.
    Last edited by Brink; 22 Mar 2017 at 19:35. Reason: removed quote of 1st post
      My ComputersSystem Spec

  3.    22 Mar 2017 #3

    First screenshot you have it set to admin and only run when user logged on ie admin tick box below it run wether logged in or not
      My ComputerSystem Spec


  4. Posts : 32,544
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       22 Mar 2017 #4

    Samuria said: View Post
    First screenshot you have it set to admin and only run when user logged on ie admin tick box below it run wether logged in or not
    Good catch. Maybe change the group in the first screenshot to Administrators
      My ComputersSystem Spec


  5. Posts : 63
    Xp, Vista, 7, 8.1, 10
    Thread Starter
       22 Mar 2017 #5

    Guys, appreciate it.

    This Task Scheduler... I tell you. How do people use it?

    So if I change it on the first page to:


    Click image for larger version. 

Name:	Capture1.PNG 
Views:	19 
Size:	10.3 KB 
ID:	126317


    It boots up and gives me this error in the task history:
    Task Scheduler failed to start "\Test autorun at user logon= C=_Users_Dc_Desktop_run_pti_setup.exe" task for user "BTTM10\Admin". Additional Data: Error Value: 2147943767.
    But if I uncheck to "Do not store password", it then asked my password for Admin, which I provide to OK the task:


    Click image for larger version. 

Name:	Capture2.PNG 
Views:	19 
Size:	10.2 KB 
ID:	126318


    It then boots up and gives me this error:

    Task Scheduler failed to start "\Test autorun at user logon= C=_Users_Dc_Desktop_run_pti_setup.exe" task for user "BTTM10\Admin". Additional Data: Error Value: 2147943726.
    Well, one would assume that error 2147943726 is 41 times worse than error 2147943767. Corrent.

      My ComputerSystem Spec


  6. Posts : 32,544
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       23 Mar 2017 #6

    @ahmd

    Since you're trying to make a program/app run automatically for any specific user when they log on, maybe a different approach. Instead of going the job schedule entry way, why not set an autorun entry in the start menu folder for each user you want, or for all users. Create a shortcut to the .exe in the same folder as the .exe, giving it Run as Administrator priviledges. Then follow the steps in Option #2 in this tutorial here on Tenforums.

    Add, Delete, Enable, or Disable Startup Items in Windows 10

    Give the tutorial a look and see if this may work for you.

    TC
      My ComputersSystem Spec

  7.    23 Mar 2017 #7

    A standard user can't run elevated task at log-on.

    You'll have to either make the user part of Administrators group or give them a button to press after they log-on.
      My ComputerSystem Spec


  • Posts : 32,544
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       23 Mar 2017 #8

    lx07 said: View Post
    A standard user can't run elevated task at log-on.

    You'll have to either make the user part of Administrators group or give them a button to press after they log-on.
    That's part of his issue. They don't always remember to push the button.
      My ComputersSystem Spec

  •    23 Mar 2017 #9

    f14tomcat said: View Post
    That's part of his issue. They don't always remember to push the button.
    Indeed - but the solution is the same. Either re-write the code so it doesn't require elevation or make them Administrator. Or dock their pay if they don't press the button - that would learn 'em.

    If a standard user could run anything at all through task scheduler it would defeat the point of having a standard user.

    There is no legitimate workaround for this.
      My ComputerSystem Spec


  • Posts : 32,544
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       23 Mar 2017 #10

    lx07 said: View Post
    Indeed - but the solution is the same. Either re-write the code so it doesn't require elevation or make them Administrator. Or dock their pay if they don't press the button - that would learn 'em.

    If a standard user could run anything at all through task scheduler it would defeat the point of having a standard user.

    There is no legitimate workaround for this.
    That's why I suggested the Start Folder using Shawn's tut. It wouldn't be the user running it then, it would be Explorer. It's not uncommon for other vendors to place startup entries there in order to run with privilege. I'm only offering an alternative way of trying it to see if it fits his needs and his organizations policies, while maintaining control. A standard user (un-priviledged) would not be able to alter the entry in the Start Folder. And no button to push.

    These two lines from the tutorial tell me only an Admin could add/delete/modify these entries, and the standard user would have no input or choice....it would just run.



    NOTE: You must be signed in as an administrator to be able to do this step.
    A) In File Explorer, navigate to the hidden system folder below, and go to step 4 below.
      My ComputersSystem Spec


  •  
    Page 1 of 2 12 LastLast

    Related Threads
    Some legitimate applications require a full administrator access token (elevated) to perform their functions or tasks. For example, when a program that you are trying to run is giving you a Access Denied or No Permission type error. The User...
    Force User Preparation on User Logon in User Accounts and Family Safety
    Does anyone know how to force Windows 10 to perform its user preparation steps after a user already has a profile. I'm attempting to migrate a profile from Windows 7 to Windows 10, but the Start menu isn't working. I suspect this is because the OS...
    Hi, I use an administrative mode (elevated) command prompt to maneuver through most of my day. I have a code editor (in this case, Crimson Editor) open at all times, and when I need to edit a file quickly, I simply type cedt <filename> at the...
    I changed Command Prompt on my Taskbar so when I click on it, it opens as Administrator. That sets the default directory as C:\WINDOWS\system32 which I don't like, since any files I create that do not have a path specified will be created there. ...
    I get the message: "Interactive logon Initialisation process has failed." This occurs only once in a while, while login off from a user. I get a black screen with a dialogue box with the message and an OK button. I can't click the OK button and...
    Our Sites
    Site Links
    About Us
    Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

    Designer Media Ltd
    All times are GMT -5. The time now is 12:21.
    Find Us