windows - How to create a shortcut to launch an App with admin privileges from the cmd-line? -


i have installer (inno-setup) installs application path defined user. @ end of install routine want create shortcut starts application admin privileges. solution should work on win version winxp win7.

can achieve this?

know possible batch script, executes nasty vb-script. disadvantage cmd-window popup , works on win7 guess.

tried command mklink create hyperlink, not work because not possible pass argument set admin priviliges.

you can add registry-key tells windows execute program admin:

under hkcu\software\microsoft\windows nt\currentversion\appcompatflags\layers, add key(reg_sz) <path exe> value runasadmin. when launch exe, prompted admin-access.

with that, can create normal shortcut executable inno-setup.

if want via cmd or batch-file, can use following command:

reg add "hkcu\software\microsoft\windows nt\currentversion\appcompatflags\layers" /v "<path exe>" /t reg_sz /d runasadmin 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -