gahhon Posted January 30, 2019 Posted January 30, 2019 I would like know how can I copy a application, let's say chrome.exe, to desktop to create a shortcut and also edit the target path? Thanks
Moderators Melba23 Posted January 30, 2019 Moderators Posted January 30, 2019 gahhon, Why do you want to create a shortcut which actually points to another path than the original? M23 P.S. And just to be absolutely clear - this is the Mod team determining the legality of the thread, so everyone else please keep out. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
gahhon Posted January 31, 2019 Author Posted January 31, 2019 23 hours ago, Melba23 said: gahhon, Why do you want to create a shortcut which actually points to another path than the original? M23 P.S. And just to be absolutely clear - this is the Mod team determining the legality of the thread, so everyone else please keep out. Sorry for the late respond. Because I have a Portable Chrome and a custom made Chrome Extension. So I would like to create a Shortcut for Portable Chrome to desktop and edit the target path to add --kiosk "URL". So when the user launch the Portable Chrome shortcut at desktop will open the Chrome Browser as Kiosk mode and redirect based on URL. I also will lock the Portable Chrome folder by setting the accessibility, so that user can't launch normal Portable Chrome to disable/uninstall the custom made Chrome Extension. As I know, Portable Chrome & Google Chrome will not be merge as they will be like standalone browser application. So whatever extensions I added at Chrome Portable will not auto add into Google Chrome.
Moderators Melba23 Posted January 31, 2019 Moderators Posted January 31, 2019 gahhon, Understood - happy for the thread to remain open. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
gahhon Posted January 31, 2019 Author Posted January 31, 2019 (edited) 45 minutes ago, Melba23 said: gahhon, Understood - happy for the thread to remain open. M23 Appreciated! So now I am able to create the shortcut to desktop via FileCreateShortcut function, but how can I edit the target's path so that I can add more argument to enable kiosk mode. FileCreateShortcut($DIR_WA_FOLDER & '\GoogleChromePortable.exe', @DesktopDir & '\ChromePortable.lnk') Edited January 31, 2019 by gahhon
pixelsearch Posted January 31, 2019 Posted January 31, 2019 (edited) Hi gahhon, I guess you'll have to use a 4th parameter in FileCreateShortcut command, the "args" parameter (additional file arguments). Here is a script that helped another user, using the args parameter, it could help you too after reworking it a bit : #include <FileConstants.au3> Local $path = FileOpenDialog("Choose your exe", "C:\", _ "Select your executable (*.exe)", $FD_FILEMUSTEXIST) If @error Then Exit Local $elev = ' /c start "runhigh" /high ' Local $target = $elev & chr(34) & $path & chr(34) FileCreateShortcut("C:\Windows\system32\cmd.exe", _ @DesktopDir & "\linked.lnk", _ StringLeft($path, StringInStr($path, "\", 0, -1)), _ $target, _ "tooltip here", _ "C:\i.ico") ShellExecute("C:\Windows\system32\cmd.exe", $target) ; https://www.autoitscript.com/forum/topic/195040-filecreate-shortcut/ Good luck Edited January 31, 2019 by pixelsearch "I think you are searching a bug where there is no bug... don't listen to bad advice."
gahhon Posted January 31, 2019 Author Posted January 31, 2019 2 hours ago, pixelsearch said: Hi gahhon, I guess you'll have to use a 4th parameter in FileCreateShortcut command, the "args" parameter (additional file arguments). Here is a script that helped another user, using the args parameter, it could help you too after reworking it a bit : #include <FileConstants.au3> Local $path = FileOpenDialog("Choose your exe", "C:\", _ "Select your executable (*.exe)", $FD_FILEMUSTEXIST) If @error Then Exit Local $elev = ' /c start "runhigh" /high ' Local $target = $elev & chr(34) & $path & chr(34) FileCreateShortcut("C:\Windows\system32\cmd.exe", _ @DesktopDir & "\linked.lnk", _ StringLeft($path, StringInStr($path, "\", 0, -1)), _ $target, _ "tooltip here", _ "C:\i.ico") ShellExecute("C:\Windows\system32\cmd.exe", $target) ; https://www.autoitscript.com/forum/topic/195040-filecreate-shortcut/ Good luck Awesome. It does the trick. Thanks for the helps!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now