Same question, different langauge.
How do you do it in Java? Do you use JNI? run exe? or are there any library read/write *.lnk like POI read/write *.xls?
I used to workaround to create ".url" which is plain text INI file. But I am looking for other interesting way to do it.
doc file in a folder and select Copy and then right-click the Desktop and selectPaste Shortcut, Windows creates a . lnk file that points to the . doc file.
Right-click on your . bat file or executable JAR file. Select Create Shortcut.
How to open an LNK file. Opening an LNK file, by double-clicking it or right-clicking it and selecting Open, opens the file, folder, or program to which the LNK file points. Advanced users can edit an LNK file's properties by right-clicking the file and selecting Properties.
An LNK file is a Windows Shortcut that serves as a pointer to open a file, folder, or application. LNK files are based on the Shell Link binary file format, which holds information used to access another data object.
I would use a JNI interface if the goal is quality.
http://alumnus.caltech.edu/~jimmc/jshortcut/
For quick hacks, (on my workstation only) : System.Exec() a vbscript :-) (I know, i know).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With