Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete shortcut by code (Access 2000)

    How can i delete with code a shortcut on the desktop? Since th desktop has different names in the different computers,is there any way to refer to the desktop and delete the link there?
    For example the following code below is not valid :
    DoCmd.DeleteObject acLink, "MyLibrary (2).lnk"

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Delete shortcut by code (Access 2000)

    DeleteObject can only delete database objects (tables, queries, forms etc.) within the current database. It is not meant to delete files. You can use

    Kill "path+filename"

    to delete a file. Of course, you must substitute the correct path and filename. You already know how to refer to the desktop, see for example <post:=562,210>post 562,210</post:>.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •