Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am logged in Windows 7 (Home Premium) as user which is an administrator. When I open cmd.exe, mklink foo bar says:

You do not have sufficient priviledge to perform this operation.

I know I can run cmd.exe as administrator (via Ctrl+Shift+Enter), but I would like to create symlinks inside a bigger program (using the win32 API) which will not be running as administrator.

What is the way to enable symlinks for programs running as user (which has administrative privileges), but running the program normally, without explicit elevation?

share|improve this question

1 Answer 1

Does it need to be mklink?

I've been using Junction (http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx) for a long time and it works.

I just tested and it does not need elevated privileges to run. You just need to run once and accept the EULA first. Then you are good to go.

[Edit]

Since you've mentioned in the comments that you are using C++, have you tried it implementing yourself?

http://msdn.microsoft.com/en-us/library/windows/desktop/aa363866(v=vs.85).aspx

share|improve this answer
    
Junctions only work with directories AFAIK. I need to create the link programatically, so a code to download does not help. –  eudoxos Nov 6 '12 at 14:27
    
It's for a file that you need the link? Sorry. You don't need "code to download". You need to install junction.exe once and that's all. But I don't think you'll be able to run a command that requires elevated privileges from a program running without elevated privileges. It does not make sense (from a security point of view) to me. How will you distribute your program? Which language does it use it? –  Luiz Angelo Nov 6 '12 at 14:47
    
It is a mix of python and c++. Why is symlink a security issue under Windows?! Never seen that in Linux. –  eudoxos Nov 6 '12 at 19:06
    
Why is creating symlink something for which you need special permission? Probably because someone considered it dangerous. That's what I meant. –  eudoxos Nov 6 '12 at 19:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.