View Full Version : Creating .ink shortcuts
Is there a way to create a .ink shortcut with lisp? I am copying network files to a hard drive, and would like to create a shortcut to the network directory programmatically, so it would be easy to save back to the network.
2004-06-17, 03:21 PM
Thought I could find one in McNeels DosLib library but no luck. Maybe someone here knows the answer to that.
Otherwise, you can utilize the Shell scripting object. The following function creates a shortcut based on these arguments:
target: path of file to make a shortcut to
fname: filebase name of shortcut file (without extension)
path: where to put the shortcut
(defun myShortcut (target fname path / shellObj shortcut)
(cond ((setq shellObj (vlax-create-object "WScript.Shell"))
(setq shortcut (vlax-invoke-method
(strcat path "\\" fname ".lnk")
(vlax-put-property shortcut 'TargetPath target)
(vlax-invoke-method shortcut 'Save)
Of course, you'd probably want some user interface to go with it but it should be basic stuff.
Thanks for all your help.
Powered by vBulletin® Version 4.1.11 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.