Cannot use subprocess.call with psexec.exe

I’m trying to use psexec to run a script on remote PCs but when I use subprocess.call I get WindowsError: [Error 2] The system cannot find the file specified

I have downloaded PsExec, unzipped and put all contents from the download in

C:WindowsSystem32 and my test code is:

from subprocess import call

call(['C:WindowsSystem32PsExec.exe'])

I just wanted to see if i could see the command working, but no luck.

When I try call(['C:WindowsSystem32PsExec.exe'], shell=True) I get

'C:WindowsSystem32PsExec.exe' is not recognized as an internal or external command, operable program or batch file.

When I try another propgram in that folder it seems to work… Is there something I’m immediatly missing?


Source: windows

Leave a Reply