- exportlink.vbs » exports/imports the properties of the specified link (shortcut) including the target, arguments, directory, icon, description, hotkey, and windowstyle.
There is no usage information (--help) provided by the script itself, so here it is:
USAGE:
exportlink.vbs [--export] "input.lnk" "output.txt"
exportlink.vbs --import "input.txt" "shortcut.lnk"
Here is an example:
This exports the properties from 'Beyond Compare 3.lnk' shortcut to the 'Beyond Compare 3.txt' text file.
$ exportlink.vbs "Beyond Compare 3.lnk" "Beyond Compare 3.txt"
This sets the properties in 'Beyond Compare 3.lnk' from the values in the 'Beyond Compare 3.txt' text file.
$ exportlink.vbs --import "Beyond Compare 3.txt" "Beyond Compare 3.lnk"
$ exportlink.vbs "Beyond Compare 3.lnk" "Beyond Compare 3.txt"
$ type "Beyond Compare 3.txt"
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
SOURCE: Beyond Compare 3.lnk
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TargetPath=%bin%\apps\Beyond Compare 3\BCompare.exe
Arguments=
WorkingDirectory=
IconLocation=%bin%\apps\Beyond Compare 3\BCompare.exe,0
Description=
Hotkey=
WindowStyle=1
This little utility is particularly useful as a Beyond Compare File Format.
- Create a new File Format named
Shortcuts
. - On the 'General' tab,
- Change the 'Mask' to
*.lnk
.
- Change the 'Mask' to
- On the 'Conversion' tab,
- In the 'Conversion' drop-down, select
External program (ANSI filename)
. - Set the 'Loading' text-box to
wscript.exe Helpers\exportlink.vbs %s %t
. - Make sure 'Disable editing' is unchecked.
- Set the 'Saving' text-box to
wscript.exe Helpers\exportlink.vbs --update %s %t
. - Make sure 'Trim trailing whitespace' is unchecked. (Or else, after a save bc may show the files as different, depending on the changes made. Reload/refresh the comparison to fix.)
- In the 'Conversion' drop-down, select
The path for the Loading and Saving text-boxes can be an absolute path (such as 'C:\bin\exportlink.vbs') or a relative path. Relative paths start from the directory that BCompare.exe is located (such as 'C:\Progam Files (x86)\Beyond Compare 3').
I copy my utilities such as exportlink.vbs to the Beyond Compare 3\Helpers
directory. This is pretty much the standard that I have seen for File Format converters.