Delete Desktop Shortcut

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
 
R

Rick B

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
 
D

Douglas J Steele

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...
 
S

SusanV

Additionally, a shortcut file extension is .lnk - you won't see it in
properties but you will in DOS

;-)
 
S

SusanV

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...
 
D

DS

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
 
D

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
 
Top