开发者

Is it any way to test from vbscript if a folder is a symbolic link?

开发者 https://www.devze.com 2022-12-20 20:50 出处:网络
I have some visual basic script code in my installer and开发者_如何学JAVA i need to test that specific folder is a symbolic link or a normal folder. Is it any way to perform such task in vbscript?File

I have some visual basic script code in my installer and开发者_如何学JAVA i need to test that specific folder is a symbolic link or a normal folder. Is it any way to perform such task in vbscript?


File system items that are symbolic links have the FILE_ATTRIBUTE_REPARSE_POINT (1024) attribute set. You can check for this attribute like this:

Const FA_REPARSE_POINT = &h400

Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("C:\MyFolder")

If (f.Attributes And FA_REPARSE_POINT) = FA_REPARSE_POINT Then
  ' The folder is a symbolic link
Else
  ' The folder is a normal folder
End If
0

精彩评论

暂无评论...
验证码 换一张
取 消