Hi, any body know how to check whether a shortcut file points to valid target. I dont want to use scripting. Here is the code i am using which i dont want to use, but to give you idea


Private Function ShortCutValid(ByVal strFilePath As String) As Boolean


Dim bolret As Boolean
Dim objOshell As Object
Dim objOsh As Object
Dim sOtarget As String
On Error Resume Next
Set objOshell = CreateObject("Wscript.shell")

If Not objOshell Is Nothing Then
Set objOsh = objOshell.CreateShortcut(strFilePath)

sOtarget = objOsh.TargetPath

' check for network drive
On Error Resume Next
' keep resume next here
' 1- There might be a shortcut to network drive.
' 2- Reference to files on a removable media.
If InStr(1, sOtarget, "\\", vbTextCompare) = 0 Then
If Dir$(sOtarget) <> vbNullString Then bolret = True
If Dir$(sOtarget, vbDirectory) <> vbNullString Then bolret = True
Else
bolret = True
End If
Else
bolret = True
End If
ShortCutValid = bolret

End Function