mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-25 06:35:54 -05:00
Minor windows agent change.
This commit is contained in:
parent
d31b3336bd
commit
96223d214f
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1012,7 +1012,7 @@ function createMeshCore(agent) {
|
||||
try {
|
||||
switch (process.platform) {
|
||||
case 'win32':
|
||||
child = require('child_process').execFile(process.env['windir'] + '\\system32\\cmd.exe', ["/c", "start", url], { type: childProcess.SpawnTypes.USER });
|
||||
child = require('child_process').execFile(process.env['windir'] + '\\system32\\cmd.exe', ["/c", "start", url], { type: childProcess.SpawnTypes.USER, uid: require('user-sessions').Current().Active[0].SessionId });
|
||||
break;
|
||||
case 'linux':
|
||||
child = require('child_process').execFile('/usr/bin/xdg-open', ['xdg-open', url], { type: require('child_process').SpawnTypes.DETACHED, uid: require('user-sessions').consoleUid() });
|
||||
@ -1055,11 +1055,12 @@ function createMeshCore(agent) {
|
||||
*/
|
||||
case 'openurl': {
|
||||
if (args['_'].length != 1) { response = 'Proper usage: openurl (url)'; } // Display usage
|
||||
else { if (openUserDesktopUrl(args['_'][0]) == null) { response = 'Failed.'; } else { response = 'Success.'; } }
|
||||
else { if (openUserDesktopUrl(args['_'][0]) == null) { response = 'Failed.'; } else { response = 'Success as ' + require('user-sessions').Current().Active[0].SessionId + '.'; } }
|
||||
break;
|
||||
}
|
||||
case 'users': {
|
||||
if (meshCoreObj.users == null) { response = 'Active users are unknown.'; } else { response = 'Active Users: ' + meshCoreObj.users.join(', ') + '.'; }
|
||||
require('user-sessions').enumerateUsers().then(function (u) { for (var i in u) { sendConsoleText(u[i]); } });
|
||||
break;
|
||||
}
|
||||
case 'toast': {
|
||||
|
Loading…
Reference in New Issue
Block a user