using System() with administrator privilages

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?

 Respuesta aceptada

Jan
Jan el 17 de Oct. de 2013

0 votos

See "runas" under Windows and "sudo" under Linux/Mac.

3 comentarios

Edward
Edward el 17 de Oct. de 2013
Im running windows, can you be more precise?
Jan
Jan el 17 de Oct. de 2013
@Edward: It is your turn to be more precise. I asked in your other thread already, what kind of "shortcut" you mean, but I'm still waiting for an answer. Now it seems, like you have found a solution, so it would be useful to show it. Perhaps administrator privileges are even not enough, but you need the System level to create the wanted object.
The usage of the Windows command runas does not belong to the field of Matlab anymore. Therefore I recommend to ask an internet search engine at first for "Windows runas", and if this does not help, ask in a Windows forum.
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).

Iniciar sesión para comentar.

Más respuestas (2)

raym
raym el 6 de Mayo de 2017

0 votos

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 el 10 de Dic. de 2017

0 votos

my matlab is not opening.what i have to do?

2 comentarios

Walter Roberson
Walter Roberson el 10 de Dic. de 2017
Contact Mathworks for free installation assistance
Jan
Jan el 10 de Dic. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 17 de Oct. de 2013

Comentada:

Jan
el 10 de Dic. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by