This is a wrapper around u_shell_link
that simplifies
creating shortcuts.
The four main functions will find a shell special directory, create any required subdirectories when appropriate and create a simple shortcut file.
Creates a shortcut file anywhere in the file system. This low-level function will not create directories
string s_shortcut_name: the name of the shortcut file to create. This should have a .lnk extension
string s_target_name: the name of the executable (or other file) that the shortcut should point at
integer: 1 on success, -1 on failure.
Creates a shortcut file on the Desktop, either available to the current user or to all users that use the machine. Since I didn't see much point to creating a shortcuts in subdirectores under the desktop this function will not create subdirectories.
string s_name: the name of the shortcut file to create. This should have a .lnk extension. This should not include a path
string s_target_name: the name of the executable (or other file) that the shortcut should point at
boolean b_all_users: if this is true the shortcut will be visible to anyone who logs into this machine, otherwise it will only be visible to the current user.
integer: 1 on success, -1 on failure.
uo_shell_shortcut.uf_create_desktop_shortcut("Notepad;", "notepad.exe" true)
Creates a shortcut file on the Programs menu, either available to the current user or to all users that use the machine. This function will create the subdirectories required for submenus under the Programs menu.
string s_name: the name of the shortcut file to create. This should have a .lnk extension.
string s_target_name: the name of the executable (or other file) that the shortcut should point at
boolean b_all_users: if this is true the shortcut will be visible to anyone who logs into this machine, otherwise it will only be visible to the current user.
integer: 1 on success, -1 on failure.
// Create the normal PowerBuilder icon
uo_shell_shortcut.uf_create_programs_shortcut("Powersoft
5.0\PowerBuilder 5.0 Intel32;", "pb050.exe" true)
Creates a shortcut file on the Start menu itself, either available to the current user or to all users that use the machine. This function will create the subdirectories required for submenus under the Start menu.
string s_name: the name of the shortcut file to create. This should have a .lnk extension. This may include subdirectories.
string s_target_name: the name of the executable (or other file) that the shortcut should point at
boolean b_all_users: if this is true the shortcut will be visible to anyone who logs into this machine, otherwise it will only be visible to the current user.
integer: 1 on success, -1 on failure.
// Fast access to PowerBuilder
uo_shell_shortcut.uf_create_startmenu_shortcut("Quick\PowerBuilder 5.0
Intel32;", "pb050.exe" true)
Creates a shortcut in the Startup menu, either available to the current user or to all users that use the machine. Since I didn't see much point to creating a shortcuts in subdirectores under the Startup menu (would they execute on startup?) this function will not create subdirectories.
string s_name: the name of the shortcut file to create. This should have a .lnk extension. This should not include a path
string s_target_name: the name of the executable (or other file) that the shortcut should point at
boolean b_all_users: if this is true the shortcut will be visible to anyone who logs into this machine, otherwise it will only be visible to the current user.
integer: 1 on success, -1 on failure.
// I want the calculator available on startup
uo_shell_shortcut.uf_create_startup_shortcut("Calculator;",
"calc.exe" true)