B4J Library jShortcut

This is a wrapper for this Github project. The jni involved is included in the lib download. Copy the content to the b4j additional libs folder.

The aim of the library is to create shelllinks on windows.

DonManfred (wrapper)
Version: 1
  • ShellLink
    • Initialize (destpath As String, linkName As String, target As String)
    • Initialize2 (destpath As String, linkName As String, target As String, cmdArgs As String, desciption As String)
    • Initialize3
    • IsInitialized As Boolean
    • getSystemDirecory (dirtype As String) As String
      Get the Pat of a Systemdirectory.
      Possible values for dirtype are:
      - "desktop"
      - "programs"
      - "program_files"
      - "common_programs"
      - "common_desktopdirectory"
      - "personal"
    • save
      Save the Shelllink
    • Arguments As String [write only]
      Defined the commandline-args for the shelllink.
    • Description As String [write only]
      Set the description for the shelllink
    • DestinationPath As String [write only]
      Set the path where the link will be created
    • IconIndex As Int [write only]
      Set the Iconindex in the iconlib defined with
    • IconLocation As String [write only]
      Define the Iconlib location.
      For example "%SystemRoot%\\system32\\SHELL32.dll"
      Use setIconIndex to set a Icon from this iconlib
    • Name As String [write only]
      Set the name for the shelllink
    • Target As String [write only]
      Set the Target for the shelllink
      Usually it is the Path to an program. Or an url
    • WorkingDirectory As String [write only]
      Set the workingdiectory for the target to be executed in

    Private msLinks As ShellLink
    msLinks.IconLocation = "%SystemRoot%\system32\SHELL32.dll"
    msLinks.IconIndex = 21
    msLinks.WorkingDirectory = "G:\"
    msLinks.Arguments = "--help --option1=x"
    msLinks.Description = "Description bla bla bla"
    msLinks.DestinationPath = msLinks.getSystemDirecory("desktop")
    msLinks.Name = "B4J Shelllink"
    msLinks.Target = "https://www.b4x.com/android/forum/threads/create-windows-shortcut.62377/" '"G:\32527-116921.pdf"

If you want to donate for my work building the wrapper you can do it here:

- Example
- Library files for b4j
- Java source of the wrapper


  • jShortcutEx.zip
    1 KB · Views: 407
  • libjShortcutV1.0.0.zip
    134.3 KB · Views: 472
  • jShortcutJAVA.zip
    133.6 KB · Views: 439
Last edited:


Licensed User
Longtime User
@The Don, Anywhere Software should totally hire you!! Well done! :)