VB-Script zu Löschen Desktop-Verknüpfung

Ich brauche Hilfe mit diesem Skript. Dieses Skript erstellt auf dem desktop eine neue Verknüpfung und löscht dann eine andere. Aber ich möchte es so löschen Sie eine Verknüpfung auf dem desktop, wenn es vorhanden ist, oder einem anderen, wenn es vorhanden ist. Nicht sicher, wie dies zu tun. Ich habe die 2 anderen Verknüpfungen nach dem "fso.deletefile" aber ich bin mir nicht sicher, welche syntax zu verwenden (wie zum Wort es.) Ich bin neu in vbs. Vielen Dank im Voraus für die Hilfe.

L_Welcome_MsgBox_Message_Text = "A shortcut to the PM Master" & vbcrlf & "will be created on your desktop."
L_Welcome_MsgBox_Title_Text ="Windows Scripting Host Sample"

Call Welcome()

Dim WSHShell
Set WSHShell =CreateObject("WScript.Shell")

Dim MyShortcut, MyDesktop, DesktopPath
' Read desktop path using WshSpecialFolders object
DesktopPath =WSHShell.SpecialFolders("Desktop")
' Create a shortcut object on the desktop
Set MyShortcut =WSHShell.CreateShortcut(DesktopPath & "\PM-Master-ALL.lnk")
' Set shortcut object properties and save it
MyShortcut.TargetPath =WSHShell.ExpandEnvironmentStrings( "c:\Local Cloud\Shared\Sites\Bailey Lane\PM-Master-ALL")
MyShortcut.Save
Set Shell = CreateObject("WScript.Shell")
Set FSO = CreateObject("Scripting.FileSystemObject")
DesktopPath = Shell.SpecialFolders("Desktop")
FSO.DeleteFile DesktopPath & "\PM Master - ALL.lnk"
FSO.DeleteFile DesktopPath & "\PM Master - ALL -  Shortcut.lnk"


WScript.Echo "A shortcut to the PM Master has been successfully created. The older PM Master shortcut has been deleted."

Sub Welcome()
    Dim intDoIt
    intDoIt = MsgBox(L_Welcome_MsgBox_Message_Text, vbOKCancel + vbInformation, L_Welcome_MsgBox_Title_Text )
    If intDoIt = vbCancel Then
    WScript.Quit

End If
End Sub
InformationsquelleAutor user2493738 | 2014-01-08
Schreibe einen Kommentar