Chances are the the logged-in user does not have rights to the folder you are trying to create this in...
It was actually just the desktop and it seems to be only lnk files, can export any other name fine.
This is internet shortcut, has .url extension, not .lnk
The last time I tried to do this, the only way Windows would let me create a shortcut was to use a VBScript. I would build the script into a field, export it and open it. That file would contain all of the location info and icon path, etc.
I don't remember now what I actually used ( I can't locate the file straight away ), but this looks similar.
I didn't find the file. But I did find the actual text of the VBScript I was using at the time ( funny enough, it was in a comment on my own blog...posted by...ME ).
"There are 3 basic steps ( not accounting for how you are tracking and cleaning up the files that are created ):
1. Create a global text field to use to store “the code”. That is the VBScript code we are going to use.
2. Set the field to the VBScript code to create the shortcut ( see sample below ).
3. Export the Field Contents. Use “.vbs” as the ext. And select the “Automatically open file” option.
When windows ‘opens’ the vbs file, the shortcut will be created according to the data in the file you exported. You will then want to include a script step, or another script, to delete that vbs file you exported.
Sample VBS code to create a shortcut:
FileName = “ShortcutName”
Set shortcut = CreateObject(“WScript.Shell”).CreateShortcut(CreateObject(“WScript.Shell”).SpecialFolders(“Desktop”) & + “\” + FileName + “.lnk”)
shortcut.Description = “My Shortcut”
shortcut.TargetPath = “C:\Program Files”
You can generate this text using data in your solutions and just build the code dynamically. You can also use the design functions like Get ( DesktopPath ) to make grabbing the path easier."
thank you, it certainly isn't overly simple but the end result is nice.. thanks to all.
To give credit where credit is due: I am certain that idea/code came from Wim!!
Using text field and .url extension could make shortcut on desktop with icon in pictures folder, very simple.