WriteShortcut

Function WriteShortcut() : Boolean

Writes a shortcut created with CreateShortcut to disk. Returns TRUE on success.

Example:

Include "lnk.bb"


  CreateShortcut("My Shortcut", LNK_VOLUME_LOCAL, LNK_VOLUME_TYPE_FIXED)
    lnk\lDescription$ = "Here's my test shortcut!!!"
    lnk\lTargetPath$ = "" + CurrentDir$() + "test.txt"
    lnk\lRelativePath$ = ".\test.txt"
    lnk\lWorkingDir$ = "" + CurrentDir$()
    lnk\lCustomIcon$ = "" + CurrentDir$() + "test.ico"

If WriteShortcut() = False Then RuntimeError("Couldn't create shortcut")

  CreateShortcut("My Shortcut (2)", LNK_VOLUME_LOCAL, LNK_VOLUME_TYPE_FIXED)
    lnk\lDescription$ = "Here's another one!"
    lnk\lTargetPath$ = "" + CurrentDir$() + "test.txt"
    lnk\lRelativePath$ = ".\test.txt"
    lnk\lWorkingDir$ = "" + CurrentDir$()
    lnk\lCustomIcon$ = "" + CurrentDir$() + "test.ico"

If WriteShortcut() = False Then RuntimeError("Couldn't create shortcut")


  RuntimeError("Okay!")