'Can't open file 'path': [Errno 2] No such file or directory' Error in SQL while using xp_cmdshell command

126 views Asked by At

I am getting the error 'Can't open file 'path': [Errno 2] No such file or directory'

while trying to execute the below command in SSMS, it worked perfectly until yesterday and scheduled a job too, but later i had to move the script files from one folder to another but inside the same directory and then changed the command accordingly, since then it stopped working in SSMS. i've checked the permissions of the folder and set it to everyone and done everything, but still throwing the same error.

EXEC xp_cmdshell '//path/shared data/Python/python.exe //path/shared data/Recon_Sheet.py';  
GO

i even tried like the below too, but nothing seems to be working.

declare @cmd varchar(1000)
set @cmd = 'cd.. && "//path/path/shared data/Python/python.exe" //path/shared data/Recon_Sheet.py'
exec xp_cmdshell @cmd;  
GO

Please help me out since this is critical. thank you.

0

There are 0 answers