using System() with administrator privilages

65 views (last 30 days)
Edward
Edward on 17 Oct 2013
Commented: Jan on 10 Dec 2017
I am trying to create a shortcut using the system(command); command but i am getting output:
You do not have sufficient privilege to perform this operation.
How can i call system with administrator privileges to avoid this?

Accepted Answer

Jan
Jan on 17 Oct 2013
See "runas" under Windows and "sudo" under Linux/Mac.
  3 Comments
Edward
Edward on 17 Oct 2013
I meant a soft/symbolic link shortcut using the command:
system(['mklink "' shortcut_destination '" "' file_location '"']);
I fixed the problem by closing MATLAB and reopening it with administrator privileges. (right click matlab -> run as administrator).

Sign in to comment.

More Answers (2)

raym
raym on 6 May 2017
This also solved my problem. Thanks Edward.
I fixed the problem by closing MATLAB and reopening it with administrator privileges. (right click matlab -> run as administrator).

Fatima Abdulhakim
Fatima Abdulhakim on 10 Dec 2017
my matlab is not opening.what i have to do?
  2 Comments
Jan
Jan on 10 Dec 2017
@Fatima: Please do not hijack a thread by posting a new question in the section for answers. Open your own thread instead. If you do so, add any details: Did it work before? How do you try to open it? Which messages do you get?
Please remove this pseudo-answer after you have created your own question. Thanks.

Sign in to comment.

Tags

Products

Community Treasure Hunt

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

Start Hunting!

Translated by