From 8d992a6eaf879887eda9449ab541c9a203137e78 Mon Sep 17 00:00:00 2001 From: z00303mf Date: Sun, 28 Jun 2020 23:13:53 +0530 Subject: [PATCH] fix: wifi connect issue fix for Windows --- src/windows-connect.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/windows-connect.js b/src/windows-connect.js index f31d6a9..dda2dd7 100644 --- a/src/windows-connect.js +++ b/src/windows-connect.js @@ -5,7 +5,7 @@ var scan = require('./windows-scan'); function execCommand(cmd, params) { return new Promise(function(resolve, reject) { - execFile(cmd, params, { env }, function(err, stdout, stderr) { + execFile(cmd, params, { env, shell: true }, function(err, stdout, stderr) { if (err) { // Add command output to error, so it's easier to handle err.stdout = stdout; @@ -44,7 +44,7 @@ function connectToWifi(config, ap, callback) { ]); }) .then(function() { - var cmd = 'cmd'; + var cmd = 'netsh'; var params = [ 'wlan', 'connect',