Reputation: 23
Without admin privileges, I know I can create a symbolic link in command line:
mklink /J LinkPath OriginalResourcePath
In C++, I tried using CreateSymbolicLink; however, I got error "A required privilege is not held by the client." Is there a way to create a symlink/junction to a directory without admin privileges, equipvalent to mklink /j?
Thanks in advance!
Upvotes: 2
Views: 2086
Reputation: 612794
What you are creating with mklink /j
is not a symbolic link. It is an NTFS junction. You can create junctions without admin rights, but you need SeCreateSymbolicLinkPrivilege
to create a symbolic link. And by default only admin tokens have SeCreateSymbolicLinkPrivilege
.
So, you need to create a junction. This Code Project article shows you how to do that: http://www.codeproject.com/Articles/194/Windows-2000-Junction-Points
Upvotes: 2