Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create shortcut in windows programmatically

Is there a way to create link in windows?
I found samples that use VBScript or one has to do download Shortcut.exe.
I need a simple solution. Is that possible?

like image 558
Mady Avatar asked Oct 28 '13 07:10

Mady


People also ask

How do I create a Windows app shortcut?

Select Start , scroll to the app you want to pin, then press and hold (or right-click) the app. Select More > Pin to taskbar. If the app is already open on the desktop, press and hold (or right click) the app's taskbar icon, and then select Pin to taskbar.


1 Answers

I had the same problem, so i wrote library for parsing and creating .lnk files. It does not use VBScripts or JNI, java code only. See my Github.

Creating shortcuts: ShellLink.createLink("targetfile", "linkfile.lnk"). You can also set up most parameters of the link. See details and examples in repo.

Probably this question is not actual already, but i hope it will be helpfull for people who will find this topic in Google.

like image 150
BlackOverlord Avatar answered Sep 20 '22 20:09

BlackOverlord