import os path = os.getcwd() os.system('powershell.exe $env:path += "' + path + '\\ProgramFiles"') This outputs as $env:path += c:\programfiles
And therefore returns as an error. Can someone explain why it removes the Quotation mark from the string and a possible solution?