1 // git-gui Windows shortcut support
2 // Copyright (C) 2007 Shawn Pearce
4 var WshShell = WScript.CreateObject("WScript.Shell");
5 var argv = WScript.Arguments;
7 var lnk_path = argv.item(argi++);
8 var ico_path = argi < argv.length ? argv.item(argi++) : undefined;
9 var dir_path = argi < argv.length ? argv.item(argi++) : undefined;
10 var lnk_exec = argi < argv.length ? argv.item(argi++) : undefined;
12 while (argi < argv.length) {
13 var s = argv.item(argi++);
16 if (s.indexOf(' ') >= 0) {
25 var lnk = WshShell.CreateShortcut(lnk_path);
26 if (argv.length == 1) {
27 WScript.echo(lnk.TargetPath);
29 lnk.TargetPath = lnk_exec;
30 lnk.Arguments = lnk_args;
31 lnk.IconLocation = ico_path + ", 0";
32 lnk.WorkingDirectory = dir_path;