M
Michelle
I'm trying to delete a shortcut off the users desktop programmatically. Here
is the code I have for checking if the file exists and deleting it.
Unfortunately I can't delete it because its read only! Please help!
Function SeeIfShortcutExists()
Dim WSHShell As Object
Dim MyShortcut As Object
Dim DesktopPath As String
Dim blnFile As Boolean
Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & "\" &
"Consolidated - Approve" & ".lnk")
blnFile = Len(Dir(MyShortcut))
End With
MsgBox blnFile
If blnFile = True Then
Kill (DesktopPath & "\" & "Consolidated - Approve" & ".lnk")
End If
End Function
is the code I have for checking if the file exists and deleting it.
Unfortunately I can't delete it because its read only! Please help!
Function SeeIfShortcutExists()
Dim WSHShell As Object
Dim MyShortcut As Object
Dim DesktopPath As String
Dim blnFile As Boolean
Set WSHShell = CreateObject("WScript.Shell")
DesktopPath = WSHShell.SpecialFolders("Desktop")
Set MyShortcut = WSHShell.CreateShortcut(DesktopPath & "\" &
"Consolidated - Approve" & ".lnk")
blnFile = Len(Dir(MyShortcut))
End With
MsgBox blnFile
If blnFile = True Then
Kill (DesktopPath & "\" & "Consolidated - Approve" & ".lnk")
End If
End Function