viewpoint-particle

Author Topic: Detect if a desktop link exists  (Read 1019 times)

stanl

  • Pundit
  • *****
  • Posts: 587
Detect if a desktop link exists
« on: May 21, 2015, 07:33:28 am »
I am creating network shorcuts to exe's on user desktops. How do I detect if the shorcut already exists?

td

  • Tech Support
  • *****
  • Posts: 1983
    • WinBatch
Re: Detect if a desktop link exists
« Reply #1 on: May 21, 2015, 07:58:14 am »
Why not just look for the shortcut .lnk file in a user's desktop folder.  If you can't assume the name, you would have to check the target's of all desktop .lnk files.
"DON'T PANIC”
The Hitchhiker's Guide to the Galaxy, Douglas Adams


stanl

  • Pundit
  • *****
  • Posts: 587
Re: Detect if a desktop link exists
« Reply #2 on: May 22, 2015, 07:04:24 am »
I just kludged it setting errormode off as the shortcut was the last action. Had never really thought of using If FileExist() on the desktop folder.
 
The good news is what this is related to. The Company saves of Office licenses by using Open Office at agent desktops. As their sales are tracked in MySQL (3rd party) I originally wrote a WB exe to produce a Windows grid via Powershell, not wanting to get back into the sun.uno way of doing things.
 
However, I was able to code an Open Office function to replicate Excel's copyfromrecordset() with under 20 lines of WB code. :) :) :)