mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-26 07:05:52 -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 {
|
try {
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'win32':
|
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;
|
break;
|
||||||
case 'linux':
|
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() });
|
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': {
|
case 'openurl': {
|
||||||
if (args['_'].length != 1) { response = 'Proper usage: openurl (url)'; } // Display usage
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case 'users': {
|
case 'users': {
|
||||||
if (meshCoreObj.users == null) { response = 'Active users are unknown.'; } else { response = 'Active Users: ' + meshCoreObj.users.join(', ') + '.'; }
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case 'toast': {
|
case 'toast': {
|
||||||
|
Loading…
Reference in New Issue
Block a user