From ca9b44b3b3ec8959be2da065f77bf593129c4191 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 9 Jul 2025 11:16:53 -0700 Subject: [PATCH] Suppress stderr output from Windows registry queries --- core/control-plane/mdm/mdm.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/control-plane/mdm/mdm.ts b/core/control-plane/mdm/mdm.ts index c782105ed..6971a9882 100644 --- a/core/control-plane/mdm/mdm.ts +++ b/core/control-plane/mdm/mdm.ts @@ -132,7 +132,10 @@ function readMdmKeysWindows(): MdmKeys | undefined { try { // Use REG QUERY command to read registry values const licenseKeyCmd = `reg query "${regPath}" /v licenseKey`; - const licenseKeyOutput = execSync(licenseKeyCmd, { encoding: "utf8" }); + const licenseKeyOutput = execSync(licenseKeyCmd, { + encoding: "utf8", + stdio: ["pipe", "pipe", "pipe"], + }); // Extract values from command output const licenseKey = extractRegValue(licenseKeyOutput); if (licenseKey) { @@ -145,7 +148,10 @@ function readMdmKeysWindows(): MdmKeys | undefined { // Try HKEY_CURRENT_USER if not found in HKEY_LOCAL_MACHINE try { const licenseKeyCmd = `reg query "${userRegPath}" /v licenseKey`; - const licenseKeyOutput = execSync(licenseKeyCmd, { encoding: "utf8" }); + const licenseKeyOutput = execSync(licenseKeyCmd, { + encoding: "utf8", + stdio: ["pipe", "pipe", "pipe"], + }); // Extract values from command output const licenseKey = extractRegValue(licenseKeyOutput); if (licenseKey) {