A
A
Anton2021-09-12 23:37:26
System administration
Anton, 2021-09-12 23:37:26

Is it possible to run an exe that requires admin rights via bat?

Greetings!
Tell me if it is possible to run the program as administrator via bat and skip this confirmation:
613e64881a0bb217378544.pngThe launch itself:

:runscript
start "" "C:\Program Files\Test\start.exe"
TIMEOUT 10800 /NOBREAK
goto runscript

Tried runas does not help.
Issue in Windows 10

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
pavelsha, 2021-09-13
@boypush

You can use the scheduler, including the one built into Windows.
They have the functionality to run on behalf of a specific user.
or google about SaveCrendetials.
About 7 years ago we successfully solved a similar problem.
But if you do not have administrative rights on the computer, and you decide to bypass it somehow... Look for answers in other forums

C
CityCat4, 2021-09-13
@CityCat4

Hm. As I understand it, you decided to play with the corporate security system? It's not worth it :) You can't run it like that, of course - batch files are just a list of commands passed to the same command processor as input.
If you are your own administrator, you can disable this request, but if there is another user on your computer, it is not recommended to do this.

V
Viktor, 2021-09-13
@MadLor

You can of course ... the only question is why?
Create a BAT file with the following content:

Set ApplicationPath="D:\program.exe"
cmd /min /C "set __COMPAT_LAYER=RunAsHighest && start "" %ApplicationPath%"

And we already run this BAT file using runas /user:Administrator "Path to BATnik"
Only use the built-in Administrator account. A user in the "Administrators" group will not work (did not work for me).
In general, you can read HERE and HERE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question