Run an app WITH FULL ADMIN rights on windows startup FOR A Standard User

Ahsan Taqveem 5 Reputation points
2023-07-15T11:21:43.98+00:00

Hi Dear Community/Microsoft Support,

I have two accounts on my windows right now:
Account-1: Admin (A full privileged admin)
Account-2: Ahsan (Standard user | Non-admin)

What I want is to run following three applications WITH FULL ADMIN RIGHTS for Account-2 on windows starts up:

1- C:\Program Files (x86)\ASUS\ArmouryDevice\dll\ArmourySocketServer\ArmourySocketServer.exe

2- C:\Program Files (x86)\ASUS\ArmouryDevice\dll\SwAgent\ArmourySwAgent.exe

3- C:\Program Files (x86)\Samsung\Samsung Magician\SamsungMagician.exe

I tried following ways:

Method 1:

Ran Task Schedular (with Admin user); Scheduled the task to run with HIGH PRIVILEGES check; chose with Admin account;
Image

Tried both options:
1- Run only when the user is logged on
2- Run whether the user is logged in or not

Method 2:

C:\Windows\System32\runas.exe /user:PCNAME\Admin /savecred "C:\Program Files (x86)\ASUS\ArmouryDevice\dll\ArmourySocketServer\ArmourySocketServer.exe"

put this elevated shortcut in the startup folder.

Method 3:

Ran a windows batch file with following piece of code:

Set ApplicationPath="C:\Program Files (x86)\ASUS\ArmouryDevice\dll\ArmourySocketServer\ArmourySocketServer.exe"
cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" %ApplicationPath%"

put the batch file shortcut in the startup folder

NONE OF THE ABOVE THREE METHODs ARE WORKING.

I believe in the past on windows 10, I used to run the ASUS tasks via the task schedular. It just does not work anymore.
I am on windows 11 home 22H2 (Build 22621.1702)

Somebody please help me,
Please rescue me from entering the admin password three times on windows startup for those three applications that I mentioned above:

Image

I Shall be very thankful.
Ahsan.

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. MotoX80 36,401 Reputation points
    2023-07-16T01:06:36.3566667+00:00

    I believe in the past on windows 10, I used to run the ASUS tasks via the task schedular. It just does not work anymore.

    How did you determine that it is not working? Does the task show as "running"? Do you see the program running in the Task Manager details tab? What did you use as a trigger? In your image it shows "History (disabled)"; you should enable that so you can see when the task starts and stops.

    Since the task is using an account that is different from the desktop user, you will need to use "Run whether the user is logged in or not". That means that any window that the program displays will not be visible to the desktop user. If these are command line programs, you can redirect stdout and stderr to a file so that you can see the output. If they are GUI programs then you are out of luck.

    Have you asked for help in an Asus forum? Based on the program names, I have to question why they are not defined to run as a Windows service. That would solve your problem.

    Obvious question... why can't these programs run as the desktop user? What do they do that requires administrator level access? The Samsung program looks like it only needs to run when the admin wishes to perform SSD management.

    Obvious question... why can't these programs run as the desktop user? What do they do that requires administrator level access? The Samsung program looks like it only needs to run when the admin wishes to perform SSD management.


  2. MotoX80 36,401 Reputation points
    2023-08-02T21:15:37.9033333+00:00

    What would you say?

    I have 2 options that might work.

    If you have not set Powershell's execution policy, open a powershell prompt with "run as administrator" and run this command. "set-executionpolicy RemoteSigned".

    Create a file named "C:\Users\Ahsan\Desktop\Launch.ps1" with this content.

    get-process ArmourySocketServer -ErrorAction SilentlyContinue | stop-process -force 
    get-process ArmourySwAgent -ErrorAction SilentlyContinue | stop-process  -force 
    get-process SamsungMagician -ErrorAction SilentlyContinue | stop-process  -force 
    start-process ArmourySocketServer.exe -WorkingDirectory  "C:\Program Files (x86)\ASUS\ArmouryDevice\dll\ArmourySocketServer" 
    start-process ArmourySwAgent.exe -WorkingDirectory "C:\Program Files (x86)\ASUS\ArmouryDevice\dll\SwAgent" 
    start-process SamsungMagician.exe -WorkingDirectory "C:\Program Files (x86)\Samsung\Samsung Magician" 
    start-sleep -seconds 30  
    

    Create a file named "C:\Users\Ahsan\Desktop\StartProcesses.bat" with this content. (Using your admin account name.)

    runas.exe /user:YourAdminName /savecred "powershell.exe -command "start-process powershell.exe C:\Users\Ahsan\Desktop\Launch.ps1 -verb runas" 
    timeout /t 30
    

    Don't put Launch.ps1 in a folder that has a space in the name. That way we don't have to deal with quotes.

    The first time that you run StartProcesses.bat you will be prompted for a password, but from then on you should only get the UAC prompt where you can just click on ok.

    I added the sleep/timeout commands to give you some time to look for error messages.

    The other option is some freeware that I have not personally used but I've seen where other users replied that it worked for them.

    https://www.runasrob.com/

    You would configure it to launch Powershell.exe to execute the Launch.ps1 file with administrator credentials. I don't know what UAC prompts you might get.

    Let me know if that works for you.


  3. Marc Gutt 0 Reputation points
    2024-11-07T19:49:33.8433333+00:00

    Take a look at this question/answers:

    https://learn.microsoft.com/en-us/answers/questions/1021785/windows-11-22h2-cant-use-saved-credential

    It seems the "Credential Guard" is the problem.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.