I have a msi installer that needs to be run in silent mode. For that I need to run the installer in silent mode through an elevated command prompt. How can I launch the cmd in elevated mode and then run the command to execute installer from that elevated cms using a batch file?
Asked
Active
Viewed 4,647 times
0
-
same question : http://stackoverflow.com/questions/11525056/how-to-create-a-batch-file-to-run-cmd-as-administrator – r3ap3r Mar 13 '14 at 05:52
-
I need to schedule the batch file on a daily basis.So, I cannot enter the password every time. It has to be automated. Is there any other way out? – Siddhant Mar 13 '14 at 05:55
-
This might help you : http://stackoverflow.com/questions/7044985/how-can-i-auto-elevate-my-batch-file-so-that-it-requests-from-uac-admin-rights – r3ap3r Mar 13 '14 at 05:58
-
nah..nothing..What if I schedule my batch file to run with highest privileges? What happens in that case? – Siddhant Mar 13 '14 at 06:04
-
1That should probably work. – r3ap3r Mar 13 '14 at 06:06
-
Scheduling the batch file with highest privileges does work for me. – Siddhant Mar 13 '14 at 07:02
2 Answers
1
- Make a batch file and call the msi installer from it.
- Then create a shortcut to the batch file.
- Right click on the shortcut -> Properties -> Shortcut tab -> Advanced.
- Click Run as administrator. Execute the batch script from the shortcut.
- In the scheduler, give the path to this shortcut.

r3ap3r
- 2,775
- 2
- 17
- 16
1
If you want all programs (including command prompt) to run in admin mode by default, then disable UAC by making enableLUA=0 in registry. Note that this change will prompt for system restart.
EnableLUA can be found under HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System.
Once the system comes up, then all programs will run in elevated (admin) mode by default.

Kathir Softwareandfinance
- 289
- 3
- 4