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

Page 1 of 2 12 LastLast

  1. Posts : 186
    Xp, Vista, 7, 8.1, 10
       #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:

    How to set up elevated process to run at user logon?-0.png


    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:

    How to set up elevated process to run at user logon?-1.png

    do it at logon only, for the Dc account:

    How to set up elevated process to run at user logon?-2.png

    to run our elevated file:

    How to set up elevated process to run at user logon?-3.png

    with these conditions:

    How to set up elevated process to run at user logon?-4.png

    and these settings:

    How to set up elevated process to run at user logon?-5.png

    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:


    How to set up elevated process to run at user logon?-6.png


    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 Computer


  2. Posts : 56,830
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #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 Computers


  3. Posts : 8,110
    windows 10
       #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 Computer


  4. Posts : 56,830
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #4

    Samuria said:
    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 Computers


  5. Posts : 186
    Xp, Vista, 7, 8.1, 10
    Thread Starter
       #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:


    How to set up elevated process to run at user logon?-capture1.png


    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:


    How to set up elevated process to run at user logon?-capture2.png


    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 Computer


  6. Posts : 56,830
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #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 Computers


  7. Posts : 5,478
    2004
       #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 Computer


  8. Posts : 56,830
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #8

    lx07 said:
    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 Computers


  9. Posts : 5,478
    2004
       #9

    f14tomcat said:
    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 Computer


  10. Posts : 56,830
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #10

    lx07 said:
    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 Computers


 

  Related Discussions
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 15:57.
Find Us




Windows 10 Forums