简体   繁体   English

SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE,创建SymbolicLink

[英]SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE, Create SymbolicLink

I have a need to create symlinks programmatically 我需要以编程方式创建符号链接

In the field the users will not have Admin privileges, but the links will be created by this helper exe which will be run under the credentials of a user with create symlink privileges. 在该字段中,用户将不具有管理员权限,但链接将由此助手exe创建,该助手将在具有create symlink权限的用户的凭据下运行。 The helper exe is C#. 帮助程序exe是C#。

I have give a user account the require privilege, but the app wont create links unless its run as admin I tried adding a manifest and setting permissions to highestAvailable 我已经为用户帐户提供了require权限,但应用程序不会创建链接,除非以管理员身份运行我尝试添加清单并将权限设置为highestAvailable

I found looking around pages claiming theres an additional flag for CreateSymlink SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE value 0x02 我发现环顾四周的页面声称这是一个额外的标志,用于CreateSymlink SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE值0x02

Seemed like just what I needed I tried that but get back error 87, Invalid Parameter 似乎就像我需要的那样我尝试了但是得到了错误87,无效的参数

This program worked under Windows7 pro, but under Windows 10 its failing 这个程序在Windows7 pro下运行,但在Windows 10下它失败了

Any help is appreciated. 任何帮助表示赞赏。

This flag appears to be introduced in the new Windows 10 build 14972 - it won't work before that. 此标志似乎是在新的Windows 10版本14972中引入的 - 在此之前它将无法工作。 (Creators Update) Your application might have worked on Win 7 because the flag was simply ignored. (创建者更新)您的应用程序可能已在Win 7上运行,因为该标志被忽略了。

Additionally you will need to have Developer Mode on. 此外,您还需要启用开发者模式。 Source 资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM