如何在Windows下使用vbscript创建软链接 [英] How to create soft link under windows using vbscript

查看:127
本文介绍了如何在Windows下使用vbscript创建软链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用vbscript在Windows中创建软链接
请帮助我

i want to create the soft link in windows using vbscript
please help me

推荐答案

这是一个有趣的问题,但是VBScript ...我对此表示怀疑.

NTFS支持POSIX,因此可以同时使用软链接"和硬链接":创建和删除它们,检查文件结构以查找链接或确定两个或多个不同的文件是否硬链接在一起,因此它们代表了同一物理文件位于文件系统的不同位置.由于这两个功能,NFTS并不是一棵树,而是可以表示为任何常规结构的图形,可能带有循环引用.许多常见的文件搜索算法会失败,并进入无限循环.

我已经使用了两者,但是使用了原始Windows API.

对于软链接,Windows关键字是"reparse point".您可以找到很多有用的信息:
http://bit.ly/wAnTYt [ ^ ].

请参阅:
http://en.wikipedia.org/wiki/Reparse_point [ http://msdn.microsoft.com/en-us/library/aa365503%28v = VS.85%29.aspx [ ^ ].

您可以使用Windows Sysinternals中称为Junction的实用程序.您可以下载它,然后从脚本中执行它:
http://technet.microsoft.com/en-us/sysinternals/bb896768 [ ^ ].

如果我没有记错的话,过去,Mark Russinovich提供了此实用程序的源代码,您可以在其中学习它的工作原理,但现在找不到了.

顺便说一句,Sysinternals Suite是一组非常好的实用程序,每个开发人员都应该拥有这些实用程序:
http://technet.microsoft.com/en-us/sysinternals/bb842062 [ ^ ].

—SA
This is an interesting question, but VBScript… I doubt it.

NTFS supports POSIX, so it can work with both "soft links" and "hard links": create and removed them, examine file structure to find the links or determine if two or more different files are hard-linked together, so they represent the same physical file in different locations of the file system. Thanks to these two features, NFTS is not a tree, but can be presented as a graph of any general structure, possibly with circular references. Many usual file search algorithms would fail, going into infinite loops.

I''ve use the both, but using raw Windows API.

For the soft link, the Windows keyword is "reparse point". You can find a lot of useful information:
http://bit.ly/wAnTYt[^].

Please see:
http://en.wikipedia.org/wiki/Reparse_point[^].
http://msdn.microsoft.com/en-us/library/aa365503%28v=VS.85%29.aspx[^].

You can use the utility from Windows Sysinternals called Junction. You can download it and just execute it from your script:
http://technet.microsoft.com/en-us/sysinternals/bb896768[^].

If I''m not much mistaken, in the past Mark Russinovich offered the source code of this utility, where you could learn how it works, but now I cannot find it.

By the way, the Sysinternals Suite is a very good set of utilities, something every developer should have:
http://technet.microsoft.com/en-us/sysinternals/bb842062[^].

—SA


这篇关于如何在Windows下使用vbscript创建软链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆