 if process.env.SystemRoot
   system32Path = path.join(process.env.SystemRoot, 'System32')
   regPath = path.join(system32Path, 'reg.exe')
+  powershellPath = path.join(system32Path, 'WindowsPowerShell', 'v1.0', 'powershell.exe')
   setxPath = path.join(system32Path, 'setx.exe')
 else
   regPath = 'reg.exe'
+  powershellPath = 'powershell.exe'
   setxPath = 'setx.exe'
 
 # Registry keys used for context menu

    error?.code ?= code
    error?.stdout ?= stdout
    callback?(error, stdout)

# Spawn reg.exe and callback when it completes
spawnReg = (args, callback) ->
  spawn(regPath, args, callback)

# Spawn setx.exe and callback when it completes
spawnSetx = (args, callback) ->


# Get the user's PATH environment variable registry value.
getPath = (callback) ->
  spawnPowershell ['[environment]::GetEnvironmentVariable(\'Path\',\'User\')'], (error, stdout) ->
    if error?
      return callback(error)

    pathOutput = stdout.replace(/^\s+|\s+$/g, '')
    if isAscii(pathOutput)
      callback(null, pathOutput)
    else
      # FIXME Don't corrupt non-ASCII PATH values
      # https://github.com/atom/atom/issues/5063
      callback(new Error('PATH contains non-ASCII values'))

# Uninstall the Open with Atom explorer context menu items via the registry.
uninstallContextMenu = (callback) ->
