I know there is a package PyPsExec but I'm asking why this happens and how to solve it. The command psexec -s -i -d \\<PC-NAME> -u <UserName> -p <Password> <Command> works when typed manually at PowerShell, however with Python as: from subprocess import Popen,PIPE p = Popen("""psexec -s -i -d \\<PC-NAME> -u <UserName> -p <Password> <Command>""", stdin=PIPE, stdout=PIPE, shell= True ) stdout, stderr = p.communicate() print(stdout, stderr) I get: 'psexec' is not recognized as an internal or external command, operable program or batch file. b'' None Any idea why? PsExec is configured at variable path. I get the same error for PsKill. Continue reading...