Not able to retrieve file from server to local using WINSCP through python code

Advertisement

vickyRocker
Joined:
Posts:
1
Location:
USA

Not able to retrieve file from server to local using WINSCP through python code

I am trying to retrieve a csv file from server using WINSCP through python code -
Here is my command -


s = start /wait cmd /cd C:\dir1\WinSCP\winscp.com /command "open sftp://username:password@hostName.com/" "get /dir1/dir2/dir3/file.csv C:\Users\eclipse-python\project\src\dir1\dir2\ " "exit"

And I am doing os.system(s)

After i execute the command, there is a cmd pop up that appears for a second and then disappears. Also the file.csv is not retrieved.

I

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,390
Location:
Prague, Czechia

Re: Not able to retrieve file from server to local using WINSCP through python code

The cmd has no /cd switch. You probably wanted to use /c.

Though it makes no sense to run winscp.com via cmd anyway. Run it directly.

Reply with quote

Advertisement

You can post new topics in this forum