Update system.js

This commit is contained in:
Namhyeon Go 2020-07-19 07:52:32 +09:00
parent 1d6db047db
commit e8acc57830

View File

@ -8,7 +8,7 @@ var scope = {
require: global.require require: global.require
}; };
var SHELL = require('lib/shell'); var SHELL = require("lib/shell");
var WSH = CreateObject("WScript.Shell"); var WSH = CreateObject("WScript.Shell");
var WMI = GetObject("winmgmts:\\\\.\\root\\CIMV2"); var WMI = GetObject("winmgmts:\\\\.\\root\\CIMV2");
var FSO = CreateObject("Scripting.FileSystemObject"); var FSO = CreateObject("Scripting.FileSystemObject");
@ -113,4 +113,15 @@ scope.getCurrentProcesses = function() {
return processes; 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; return scope;