From 9aa8691b773fc2b487289fee755e3b19609292d7 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Thu, 22 Apr 2021 19:47:05 -0700 Subject: [PATCH] Fixed Windows Clipboard issue with setclip --- agents/meshcore.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index 39842497..885587e0 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -989,12 +989,11 @@ function handleServerCommand(data) { } else { - var tmp = "require('clipboard')(\"" + data.data.split('"').join('\\"') + '");process.exit();'; + var tmp = "require('clipboard')(" + JSON.stringify(data.data) + ');process.exit();'; tmp = Buffer.from(tmp).toString('base64'); var uid = require('user-sessions').consoleUid(); - var user = require('user-sessions').getUsername(uid); var domain = require('user-sessions').getDomain(uid); - + var user = domain + '\\' + require('user-sessions').getUsername(uid); var taskoptions = { env: { _target: process.execPath, _args: '-b64exec ' + tmp, _user: user } }; for (var c1e in process.env) {