[SC] How to create .lnk shortcut?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
binocular222
Posts: 1423
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

[SC] How to create .lnk shortcut?

Post by binocular222 »

How to create .lnk shortcut to a file via scripting?
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: [SC] How to create .lnk shortcut?

Post by SkyFrontier »

Never managed to set file properties to a fresh file, someone out there may have a best method than this:

Code: Select all

   $a = get(selecteditemspathnames);

   foreach ($tk, $a, "<crlf>") {

   selectitems "$tk";
   #168; #803;
                               }

   selectitems "$a";

//File / File Special / Create Shortcut(s): #168; Move to Other Pane: #803
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Quaraxkad
Posts: 183
Joined: 20 Apr 2014 18:01

Re: [SC] How to create .lnk shortcut?

Post by Quaraxkad »

NirCmd can create shortcuts, and is an indispensable tool for heavy command line users. Not exactly sure what the syntax would be in an XY script, something like: open "nircmd shortcut ""$target"" ""$folderforlnkfile"" ""$lnkfilename""";

PeterH
Posts: 2827
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: [SC] How to create .lnk shortcut?

Post by PeterH »

What about #168?
[File / File Special / Create Shortcut(s)]

binocular222
Posts: 1423
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Re: [SC] How to create .lnk shortcut?

Post by binocular222 »

Oh, yes, nircmd, just forgot that Swiss knife.
@PetherH: #168 only create shortcut for <selitems>, while for scripting, I mean items from various locations
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: [SC] How to create .lnk shortcut?

Post by bdeshi »

With vbs: http://ss64.com/vb/shortcut.html
You can do ^ that ^ without creating a new vbs file for each shortcut, by passing shortcut parameters as commandline arguments to the vbs.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

binocular222
Posts: 1423
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Re: [SC] How to create .lnk shortcut?

Post by binocular222 »

Yeah, many workarounds, but it's still better if XY Scripting support this "fairly basic" operation
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: [SC] How to create .lnk shortcut?

Post by bdeshi »

*nod* +1.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: [SC] How to create .lnk shortcut?

Post by SkyFrontier »

+1
For the time being Paper Folders makes easy to deal with multi-sources, but that's far from script-nirvana.
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Post Reply