Can a task be run as an administrative user from standard user profile from command line

2k views Asked by At

I am trying to run a program, specifically CoreTemp 1.0, from a batch file. The user account I am trying to run from is a standard user and i need to run it without the UAC prompting, however i would prefer not to turn off UAC. The best solution I can come up with is run CoreTemp using a scheduled task with highest privileges using the command

runas /savecred /user:<username with admin access> "start /b schtasks /run /tn <task name>"

When I run this command while logged in as the standard user account, it returns error

2: The system cannot find the file specified.

Note the start /b is only there to keep the command window open and allow me to see the error code. Also note the <username with admin access> is not the default administrator account.

Does anyone have any idea what could be wrong, or even a better way to run the program from a standard user without the UAC prompt. I thought about enabling the default admin account and point the runas command to it, but i feel like that could lead to a massive security breech. Any way I go, the program needs to start from a batch command. I would also prefer to not need to use some third party program or exe to "whitelist" CoreTemp, but if that is the only option I am open to suggestions.

UPDATE: This question has not a duplicate question as the question referenced. I need to launch a program WITHOUT the UAC control popping up asking for permission.

1

There are 1 answers

0
user318814 On

I realize this question is quite old, but I think it might be helpful for someone searching "the system cannot find the file specified"; that question is not answered here.

Task Scheduler stores tasks in folders. If the taskname you're trying to run is in any folder other than the top level folder, you have to use the fully-qualfied task name. So, even if the /tn name you specify is "right", if it's stored in any folder other than the top level folder, you will get "ERROR: The system cannot find the file specified."

C:\Windows\system32>schtasks /run /tn "task in named folder" ERROR: The system cannot find the file specified.

C:\Windows\system32>schtasks /run /tn "\phil test\task in named folder" SUCCESS: Attempted to run the scheduled task "\phil test\task in named folder".