diff --git a/lib/registry.js b/lib/registry.js index 6319ae3..8d55403 100644 --- a/lib/registry.js +++ b/lib/registry.js @@ -613,7 +613,7 @@ Registry.prototype.get = function get (name, cb) { if (name == '') args.push('/ve'); else - args = args.concat(['/v', name]); + args = args.concat(['/v', `"${name}"`]); pushArch(args, this.arch); @@ -622,6 +622,7 @@ Registry.prototype.get = function get (name, cb) { env: process.env, shell: true, windowsHide: true, + windowsVerbatimArguments: true, stdio: [ 'ignore', 'pipe', 'pipe' ] }) , buffer = '' @@ -704,9 +705,9 @@ Registry.prototype.set = function set (name, type, value, cb) { if (name == '') args.push('/ve'); else - args = args.concat(['/v', name]); + args = args.concat(['/v', `"${name}"`]); - args = args.concat(['/t', type, '/d', value, '/f']); + args = args.concat(['/t', type, '/d', `"${value}"`, '/f']); pushArch(args, this.arch); @@ -715,6 +716,7 @@ Registry.prototype.set = function set (name, type, value, cb) { env: process.env, shell: true, windowsHide: true, + windowsVerbatimArguments: true, stdio: [ 'ignore', 'pipe', 'pipe' ] }) , error = null // null means no error previously reported. @@ -758,7 +760,7 @@ Registry.prototype.remove = function remove (name, cb) { if (typeof cb !== 'function') throw new TypeError('must specify a callback'); - var args = name ? ['DELETE', this.path, '/f', '/v', name] : ['DELETE', this.path, '/f', '/ve']; + var args = name ? ['DELETE', this.path, '/f', '/v', `"${name}"`] : ['DELETE', this.path, '/f', '/ve']; pushArch(args, this.arch); @@ -767,6 +769,7 @@ Registry.prototype.remove = function remove (name, cb) { env: process.env, shell: true, windowsHide: true, + windowsVerbatimArguments: true, stdio: [ 'ignore', 'pipe', 'pipe' ] }) , error = null // null means no error previously reported.