実際にはジャンクションであるフォルダーC:\the Junction\test
があり、実際のパス(ターゲット)はD:\the real\path\to\the folder
です。
VBScript で実際のターゲット パスを見つけるにはどうすればよいですか?
このコードを試してみてください:
Set p = CreateObject("WScript.Shell").Exec("cmd /c @echo off & for /f ""tokens=5,6"" %a IN ('dir ""c:\the junction"" /a:d ^|find ""test""') do echo The real path of ""%a"" is %b")
Do While p.Status = 0
WScript.Sleep 100
Loop
WScript.Echo p.StdOut.ReadAll