Create A Shortcut In PowerBuilder
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
oleobject ws, loo_shortcut String ls_desktop //Connect wscript shell ws = Create oleobject ws.ConnectToNewObject("WScript.Shell") // other "specialfolder" of interest // AllUsersDesktop // AllUsersStartMenu // AllUsersPrograms // AllUsersStartup // Desktop // Favorites // MyDocuments // Programs // Recent // SendTo // StartMenu // Startup //Get desktop directory ls_desktop = ws.SpecialFolders("Desktop") //Add Shortcut to desktop loo_shortcut = ws.CreateShortcut(ls_desktop +"\mysoft.lnk") //original my application loo_shortcut.TargetPath = "c:\mysoft\mysoft.exe" loo_shortcut.WorkingDirectory = ls_desktop // 1 Activates and displays a window. // If the window is minimized or maximized, the system restores it to // its original size and position. // 3 Activates the window and displays it as a maximized window. // 7 Minimizes the window and activates the next top-level window. loo_shortcut.WindowStyle = 1 loo_shortcut.IconLocation = ws.ExpandEnvironmentStrings("%WINDIR%\SYSTEM\url.dll , 0") loo_shortcut.Save |
Good Luck!
Subscribe
Login
0 Comments
Oldest