mklink 到环境变量路径的连接点
我想知道是否可以使用使用 junction (或 mklink?) 让 c:\Projects 指向当前用户我的文档\projects 映射。
我尝试了 junction.exe c:\project "%HOMEPATH%\my Documents\projects" 但它只是链接到路径的解释而不是变量(因此 c:\projects 将指向管理员\我的文档\项目而不是 %HOMEPATH%)。
我使用的是 Windows Server 2003 R2。
谢谢你!
I was wondering if it were posible to use use junction (or mklink?) to have c:\Projects point to the current users my documents\projects map.
I tried junction.exe c:\project "%HOMEPATH%\my documents\projects" but it just makes a link to the interpretation of the path and not to the variable (so c:\projects would point to administrator\my documents\projects instead of %HOMEPATH%).
I'm using Windows Server 2003 R2.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不可能完全按照您所描述的进行操作。即有一个基于环境变量动态路由自身的连接点。
您可以通过创建一个登录脚本来接近这种行为,该脚本在用户登录时删除并重新创建联结。显然,这只在一次只有一个用户登录到该框中的情况下才有效,否则他们就会互相践踏。
It isn't possible to do exactly what you are describing. i.e. Have a Junction that dynamically routes itself based on an environment variable.
You can get close to this behavior by creating a logon script that deletes and recreates the junction when the user logs in. Obviously this only works if there is only ever one user logged into the box at a time, otherwise they would be stomping over each other.