WinBatch® Technical Support Forum

Archived Boards => WinBatch Dynamic Dialogs => Topic started by: stanl on May 21, 2015, 07:33:28 AM

Title: Detect if a desktop link exists
Post by: stanl 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?
Title: Re: Detect if a desktop link exists
Post by: td 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.
Title: Re: Detect if a desktop link exists
Post by: stanl 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. :) :) :)