2
I need to invoke a program with admin privileges from command prompt. it should prompt to the user an alert such as:
I found many answers like:
runas.exe /user:administrator %~dp0\MY_PROGRAM.BAT
But it does not help me, because that in this way, the program run under Administrator account while I need this program to be run under the same user that invokes my script.
I'm working on Win7/8 and Server 2008 R2
How are you trying to launch the software from the command prompt whilst logged in as the user? UAC prompt will pop up for the user then ask for credentials to make changes however the actual software will still run as the end user... – CharlesH – 2014-09-11T10:12:37.187
I didn't get you, why UAC prompt will pop up for the user? Let's say that the script & the program are stored in a local shared folder (e.g. C:\Shared_Folder) – elady – 2014-09-11T10:44:56.027
Ok sorry let me approach this another way. How are you going to be invoking this program? – CharlesH – 2014-09-11T10:48:24.030
I'm just calling the program directly from the script – elady – 2014-09-11T11:41:44.233
More high level though, are in front of the pc running the script or does it run at login or as a scheduled task, etc? – CharlesH – 2014-09-11T11:42:31.907
The user runs the script, and the script calls the program. – elady – 2014-09-11T12:26:55.920