I have a python script from which i am executing a process on remote machine as follows:
sample= sp.Popen( ['c:/psexec/PsExec.exe','-i','-s','\\\\' + 'xyz','-u', 'sample','-p', 'xyz','C:/sample.bat'],stdin=sp.PIPE, stdout = sp.PIPE, stderr=sp.PIPE)
It executes well but what i want not to provide complete exe path as follows:
sample= sp.Popen( ['psexec','-i','-s','\\\\' + 'xyz','-u', 'sample','-p', 'xyz','C:/sample.bat'],stdin=sp.PIPE, stdout = sp.PIPE, stderr=sp.PIPE)
It does not work when i remove the complete psexec exe path. So, suggest what am i not doing right and how shall i execute python script using only psexec keyword.