Command-line utility to create shortcuts ?

  • Thread starter Thread starter Antoine
  • Start date Start date
A

Antoine

Hello,

A few monthes ago, I came across a tool capable of "batch" creating
shortcuts in any directory (not only on the desktop) but I
definitely cannot remember what its name was. Any advice would be
greatly appreaciated.

Thanks,
Antoine
 
Le 18 Apr 2005 13:58:59 GMT, Antoine a écrit :
Hello,
Hi,


A few monthes ago, I came across a tool capable of "batch" creating
shortcuts in any directory (not only on the desktop) but I
definitely cannot remember what its name was. Any advice would be
greatly appreaciated.

you can compile a small AutoIt3 script containing just 2 lines :

;----------------------CreateShortCut.au3--------------------------
FileCreateShortcut ( $CmdLine[1], $CmdLine[2] )
Exit
;----------------------CreateShortCut.au3--------------------------

into CreateShortCut.exe and then

use this prog with 2 command-line arguments:
like:

CreateShortCut.exe target-file link-file


ex:
CreateShortCut.exe C:\WINNT\SYSTEM32\calc.exe "C:\Documents and
Settings\_you_\Bureau\Shortcut to MS-Calculator.lnk"

@+
 
Antoine said:
Hello,

A few monthes ago, I came across a tool capable of "batch" creating
shortcuts in any directory (not only on the desktop) but I
definitely cannot remember what its name was. Any advice would be
greatly appreaciated.

Thanks,
Antoine

There is something called WSH (Windows Scripting Host) that will allow
to do reasonably powerful scripting in Windows using Java script of VB
script or Perl script, etc. One of the things you can script is create
shortcuts like:

(Java Script)
Shell = new ActiveXObject("WScript.Shell");
DesktopPath = Shell.SpecialFolders("Desktop");
link = Shell.CreateShortcut(DesktopPath + "\\test.lnk");
link.Arguments = "1 2 3";
link.Description = "test shortcut";
link.HotKey = "CTRL+ALT+SHIFT+X";
link.IconLocation = "foo.exe,1";
link.TargetPath = "c:\\blah\\foo.exe";
link.WindowStyle = 3;
link.WorkingDirectory = "c:\\blah";
link.Save();

You don't have to use Desktop if you don't want. If you don't know WSH
then learn it as you will have no use for BAT/CMD files too much any
more.

Toad
 
Back
Top