Orangevolt ANT Tasks » Tasks » Win32 related tasks | ||
example | examples |
win32.shortcut creates Windows Shortcut files usable for Windows specific Start Menu entries, Favorites and SentTo Menu
and many more.
Since Version 1.2 this task is able to create the more flexible binary .lnk Shortcuts files.
This task's functionality is based on the Orangevolt Win32 for Java library which provides access to common Windows functionality. Orangevolt Win32 for Java is included in the orangevolt-ant-tasks-1.3.2.jar. The library is also available as separate package at Orangevolt Win32 for Java Homepage.
Especially in conjuction with win32.properties this task is a powerful tool to create ant based installations.
There exists 2 versions of shortcut files - binary and text based.
Text based shortcut files (with suffix .url) are mostly used to create shortcuts to web locations and Internet Explorer Favorites.
Binary shortcut files (with suffix .lnk) are used to create shortcuts for starting application or link to local files.
Name | Description | Required |
file | The full path to the shortcut file to create. If the path to the file does not exist it will be created. The filename HAVE TO end with either .url (for text based shortcuts) or .lnk (for binary shortcuts) to let Windows identify it as shortcut file. Use the ant variables created by win32.properties to get special windows directories. | yes |
url |
The url to the file to execute. If the url references a executable (exe, bat, cmt etc.) it will be executed,
otherwise the referenced file will be opened using the associated viewer application.
You can use the ant variables created by win32.properties to get the right directory.
url can also be defined using a child element <url>. |
yes if an .url shortcut should be created. |
execute |
The command to execute. If the command references a executable (exe, bat, cmt etc.) it will be executed.
the execute property may also contain commandline arguments.
You can use the ant variables created by win32.properties to get the right directory.
execute can also be defined using a child element <execute>. |
yes if an .lnk shortcut should be created. |
workingDirectory |
The working directory for the execution. workingDirectory can also be defined using a child element <workingDirectory>. |
no |
showCommand |
The show mode for the file. Valid values are minimized, maximized and normal. Default is normal. In most cases this attribute will be ignored by windows :-( showCommand will be ignored for .lnk shortcuts. |
no |
comment |
The comment of .lnk will be used for tooltips. comment will be ignored for .url shortcuts. |
no |
modified |
Modification date of the .url information. See Excursion to the .url File Format for details. modified will be ignored for .lnk shortcuts. |
no |
hotKey |
Hotkey to execute the shortcut. See Complete HotKey Code Reference for details. hotkey will be ignored for .lnk shortcuts. |
no |
iconFile |
The icon file to use. This may be a exe, dll or ico file. The icon file will be ignored by windows for web addresses as url parameter. |
no |
iconIndex |
The index of the icon to use inside the iconFile. Start index is always 0. |
no |