diff --git a/lib/system.js b/lib/system.js index 6ae0729..9128043 100644 --- a/lib/system.js +++ b/lib/system.js @@ -8,7 +8,7 @@ var scope = { require: global.require }; -var SHELL = require('lib/shell'); +var SHELL = require("lib/shell"); var WSH = CreateObject("WScript.Shell"); var WMI = GetObject("winmgmts:\\\\.\\root\\CIMV2"); var FSO = CreateObject("Scripting.FileSystemObject"); @@ -113,4 +113,15 @@ scope.getCurrentProcesses = function() { return processes; }; +scope.createShortcut = function(shoutcutName, fileName) { + var workingDirectory = scope.getCurrentWorkingDirectory(); + var desktopPath = WSH.SpecialFolders("Desktop"); + var link = WSH.CreateShortcut(desktopPath + "\\" + shoutcutName + ".lnk"); + link.IconLocation = fileName + ",1"; + link.TargetPath = workingDirectory + "\\" + fileName; + link.WindowStyle = 3; + link.WorkingDirectory = workingDirectory; + link.Save(); +}; + return scope;