Page 1 of 1

[SC] How to create .lnk shortcut?

Posted: 24 Aug 2014 18:11
by binocular222
How to create .lnk shortcut to a file via scripting?

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

Posted: 24 Aug 2014 21:19
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

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

Posted: 24 Aug 2014 21:49
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""";

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

Posted: 24 Aug 2014 22:03
by PeterH
What about #168?
[File / File Special / Create Shortcut(s)]

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

Posted: 25 Aug 2014 03:31
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

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

Posted: 25 Aug 2014 05:44
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.

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

Posted: 25 Aug 2014 06:08
by binocular222
Yeah, many workarounds, but it's still better if XY Scripting support this "fairly basic" operation

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

Posted: 25 Aug 2014 06:15
by bdeshi
*nod* +1.

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

Posted: 25 Aug 2014 07:16
by SkyFrontier
+1
For the time being Paper Folders makes easy to deal with multi-sources, but that's far from script-nirvana.