Always "Run as administrator" attribute on Matlab compiled executables

13 ビュー (過去 30 日間)
Fredrik Gustavsson
Fredrik Gustavsson 2016 年 8 月 4 日
コメント済み: Walter Roberson 2017 年 9 月 28 日
I would like my compiled executable files (under Windows) to have the "Always run as Administrator" attribute as default and preferably for all users and not just admins. Can this be set programatically in Matlab? The manual way is: Right click on .exe file --> Properties --> Compatibility --> etc.
Thanks!

採用された回答

Walter Roberson
Walter Roberson 2016 年 8 月 4 日
You can invoke regedit to alter the registry for that one program, on the machine it is being run on. See http://www.codeproject.com/Tips/795876/Run-Windows-Applications-as-Administrator-by-Defau
The appropriate settings do not appear to be a property of the contents of the file: they are in the registry, so you cannot just set some bits in the executable and have the effect of those bits in effect to where-ever you copy the executable to.
  3 件のコメント
Joaquin REYES
Joaquin REYES 2017 年 9 月 28 日
Hey Fredrik, Did you find a work around for this issue?. I have now the same problem. The .exe application created in Matlab doesn't run without admin rights. thanks
Walter Roberson
Walter Roberson 2017 年 9 月 28 日
Note: Fredrik would not have been notified of your comment.
There is nothing you can do at the file level to mark the file as run-as-administrator such that you could distribute the file and it would always run as administrator on target machines. The required privilege information is not stored with the file; it is stored in the registry.
You might be interested in http://www.thewindowsclub.com/create-elevated-shortcut-run-programs-bypass-uac but note these are things you can run on the target machine to mark a program to always run as administrator, which has the same effect as the registry change that I linked to above.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by