Jump to content

Recommended Posts

Posted

Hello friends,

how is it possible to make a shortcut by AutoLISP programming. I mean creating a file with .lnk extension which refers to an executeable file in Windows.

Posted

theoretically you can create any type of file by writing out to it - but you must know the coding of that type of file in order for it to be correct and readable...some files may have to be compiled in order for them to work.

Posted

To know or not to know, that is the question!

Who knows...?

Posted

AutoLisp gives you the possibility to write text out to an external file. As far as *.lnk files are concerned, you may have to visit another forum to get the details on the *.lnk file. Maybe this will giude you in the right direction => http://www.codeproject.com/KB/winsdk/makelink.aspx

Posted

LibertyOne,

thanks a lot for your help and your link:).

Posted

Please don't forget that the LNK file is a formatted type and therefore cannot be created/edited in text mode.

 

Regards,

Mircea

Posted

You can create a shortcut for a file using a VBScript routine - see code below:

With CreateObject("WScript.Shell").CreateShortcut("C:\Documents and Settings\User\Desktop\theTool.lnk")
 .TargetPath = "C:\MyTools\theTool.exe"
 .WindowStyle = 1
 .IconLocation = "C:\MyTools\theTool.exe, 0"
 .Description = "Shortcut"
 .WorkingDirectory = "C:\Projects"
 .Save
End With

I suggest you to write this by your AutoLISP code into a file with VBS extension located in the temporarily folder and run it using the code below; you may remove that file when done.

(command "_START" theBVSFilePath)

 

Regards,

Mircea

Posted (edited)
Please don't forget that the LNK file is a formatted type and therefore cannot be created/edited in text mode.

 

Regards,

Mircea

Mircea, thank you for your notice. The link LibertyOne mentioned is a library of C++ or VBA codes containing the required tasks. I am currently reviewing it to make my own code through AutoLISP.

Edited by Ahankhah
Posted
You can create a shortcut for a file using a VBScript routine - see code below:

With CreateObject("WScript.Shell").CreateShortcut("C:\Documents and Settings\User\Desktop\theTool.lnk")
.TargetPath = "C:\MyTools\theTool.exe"
.WindowStyle = 1
.IconLocation = "C:\MyTools\theTool.exe, 0"
.Description = "Shortcut"
.WorkingDirectory = "C:\Projects"
.Save
End With

I suggest you to write this by your AutoLISP code into a file with VBS extension located in the temporarily folder and run it using the code below; you may remove that file when done.

(command "_START" theBVSFilePath)

 

Regards,

Mircea

Mircea, thank you for the offer, althoght the link suggested by Lee has the exact code in Visual LISP.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...