Sample code for 30+ languages & platforms
VBScript

Get the Target of a Symbolic Link

See more FileAccess Examples

Demonstrates how to get the target of a symbolic link.

Note: This example requires Chilkat v9.5.0.77 or greater.

Chilkat VBScript Downloads

VBScript
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)

set fac = CreateObject("Chilkat.FileAccess")

targetPath = fac.SymlinkTarget("qa_data/my_symlink")
If (fac.LastMethodSuccess <> 1) Then
    outFile.WriteLine("Failed to get symlink target.")
    WScript.Quit
End If

outFile.WriteLine("target path = " & targetPath)

outFile.Close