Jump to content

Copy to desktop as shortcut and modify the target path


gahhon
 Share

Recommended Posts

  • Moderators

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.

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • Moderators

gahhon,

Understood - happy for the thread to remain open.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 by gahhon
Link to comment
Share on other sites

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 by pixelsearch
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...