1
How do I run a cmd.exe
command in msys
as a superuser? I am the only user on my laptop and have full administrative privileges once I login. I assumed I did when I fired up an msys
shell, but running:
cmd //c 'mklink link.txt file.txt'
returns that I do not have sufficient privilege to perform this operation.
open a command promopt and esclate the process by using "run as administrator" this only works if the user your using is an Administrator otherwise you have to supply the Administrator's username and password. – Ramhound – 2014-06-03T17:24:24.380
Beautiful. What I did was modify the properties of my msys shortcut to "run as administrator" and that worked perfectly. Thanks for the hint, Ramhound! – greg burgreen – 2014-06-03T17:35:26.307
Administrator rights are not required to create hard links. If that's what you were trying to do, the actual syntax would be
cmd /c mklink /h "hard link" "the target file"
– and31415 – 2014-06-03T17:42:41.100Yes, and31415 is correct. I was after symbolic links. Though, my shell required the command to be:
cmd //c mklink //h hard_link target_file
to escape the forward slash side effects on the msys bash shell. – greg burgreen – 2014-06-03T17:45:49.720The reason you were getting the not-enough-privileges error is that if you omit the
/h
switch you're creating a symbolic link, something which was first introduced in Windows Vista along with themklink
command. Per default system settings, you need administrator rights in order to create symbolic links. – and31415 – 2014-06-03T17:50:41.507