Delete Desktop Shortcut

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

Using VBA how do you delete a shortcut on the Desktop?
I thought the kill method would work, perhaps the path is wrong?
Kill c:\DS\Desktop\Shortcut

Any help appreciated.
Thanks
DS
 
Are you sure that path is correct? Did you skip the username? Do you have
the extension on the file Mine is...

"C:\Documents and Settings\usernamehere\Desktop\databasename.mdb
 
Actually, shortcuts usually have an extension of .LNK. Even if you've told
Windows Explorer to show file extensions, it's never shown. You have to look
through the DOS box...
 
Additionally, a shortcut file extension is .lnk - you won't see it in
properties but you will in DOS

;-)
 
GMTA

Douglas J Steele said:
Actually, shortcuts usually have an extension of .LNK. Even if you've told
Windows Explorer to show file extensions, it's never shown. You have to
look
through the DOS box...
 
Douglas said:
Actually, shortcuts usually have an extension of .LNK. Even if you've told
Windows Explorer to show file extensions, it's never shown. You have to look
through the DOS box...
I tried this...

Kill "C:\Documents and Settings\David\My Documents\test.lnk"

it says file ot found, I'm not trying to delete the file, just the
shortcut on the desktop.
Thanks
DS
 
DS said:
I tried this...

Kill "C:\Documents and Settings\David\My Documents\test.lnk"

it says file ot found, I'm not trying to delete the file, just the
shortcut on the desktop.
Thanks
DS
Got it!
Kill "C:\Documents and Settings\David\Desktop\test.lnk"
It was the thepath.
Thank You everyone
DS
 
Back
Top