Feedback

Pfad einer Datei-Verknüpfung ermitteln

Public Function LeseShellLinkPath(ByVal datei As String) As String

        Dim oShell As New Shell32.Shell
        Dim oFolder As Shell32.Folder
        Dim oLink As Shell32.ShellLinkObject

        Dim sPath As String
        Dim sFile As String

        Dim sLinkFile As String = datei

        ' Ordner und Dateiname extrahieren
        sPath = Left$(sLinkFile, InStrRev(sLinkFile, "") - 1)

1 Kommentar

  1. Wobei unter Net Left und Mid ja nicht das wahre ist.

    Ich würde es so schreiben:

    [code] sPath = Path.GetDirectoryName(sLinkFile)
    sFile = Path.GetFileName(sLinkFile)[/code]