Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/git-gui/lib/win32_shortcut.js # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / git-gui / lib / win32_shortcut.js` 34 lines ยท 888 bytes Raw Blame History 1 // git-gui Windows shortcut support 2 // Copyright (C) 2007 Shawn Pearce 3 4 var WshShell = WScript.CreateObject("WScript.Shell"); 5 var argv = WScript.Arguments; 6 var argi = 0; 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; 11 var lnk_args = ''; 12 while (argi < argv.length) { 13 var s = argv.item(argi++); 14 if (lnk_args != '') 15 lnk_args += ' '; 16 if (s.indexOf(' ') >= 0) { 17 lnk_args += '"'; 18 lnk_args += s; 19 lnk_args += '"'; 20 } else { 21 lnk_args += s; 22 } 23 } 24 25 var lnk = WshShell.CreateShortcut(lnk_path); 26 if (argv.length == 1) { 27 WScript.echo(lnk.TargetPath); 28 } else { 29 lnk.TargetPath = lnk_exec; 30 lnk.Arguments = lnk_args; 31 lnk.IconLocation = ico_path + ", 0"; 32 lnk.WorkingDirectory = dir_path; 33 lnk.Save(); 34 }