thorkfumble Posted May 7, 2018 Share Posted May 7, 2018 Hello all I need to replace some sftp related code in a autoit with winscp.cmd. Thus I've made sure that the filetransfer is running well on the commandline in Windows 7. Spoiler C:\Program Files (x86)\path\winscp\winscp.com /privatekey="C:\Program Files (x86)\path\winscp\ftp_ppk.ppk" user@host:/data_in /script="c:\Program Files (x86)\path\winscp\scp_script.txt" put above code in my autoit file will always fail for some reason. Spoiler Run('"C:\Program Files (x86)\path\winscp\winscp.com" /privatkey="C:\Program Files (x86)\path\winscp\ftp_ppk_mm.ppk" "user@host:/data_in" /script="c:\Program Files (x86)\path\winscp\scp_script.txt"' Any idea what I've made wrong? thanks in advance for some advice / help on this. --thork Link to comment Share on other sites More sharing options...
thorkfumble Posted May 7, 2018 Author Share Posted May 7, 2018 (edited) Hello all I need to replace some sftp related code in a autoit with winscp.cmd. Thus I've made sure that the filetransfer is running well on the commandline in Windows 7. Spoiler C:\Program Files (x86)\path\winscp\winscp.com /privatekey="C:\Program Files (x86)\path\winscp\ftp_ppk.ppk" user@host:/data_in /script="c:\Program Files (x86)\path\winscp\scp_script.txt" modified code in my autoit file will always fail for some reason. Spoiler Run('"C:\Program Files (x86)\path\winscp\winscp.com" /privatkey="C:\Program Files (x86)\path\winscp\ftp_ppk_mm.ppk" "user@host:/data_in" /script="c:\Program Files (x86)\path\winscp\scp_script.txt"' Any idea what I've made wrong? thanks in advance for some advice / help on this. --thork Edited May 7, 2018 by thorkfumble Link to comment Share on other sites More sharing options...
Developers Jos Posted May 7, 2018 Developers Share Posted May 7, 2018 What happens when you run it this way? A CMD window will open and remain open for you to read any error in case there is any: Run(@ComSpec & ' /k "C:\Program Files (x86)\path\winscp\winscp.com" /privatkey="C:\Program Files (x86)\path\winscp\ftp_ppk_mm.ppk" "user@host:/data_in" /script="c:\Program Files (x86)\path\winscp\scp_script.txt"') Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 7, 2018 Developers Share Posted May 7, 2018 (edited) Just type the reply at the bottom and hit Submit reply when you want to reply to a post as the Report button is for something totally different. Edited May 7, 2018 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
thorkfumble Posted May 7, 2018 Author Share Posted May 7, 2018 doesnt work! I get some lines in a DOS Box like 'c:\program' is not recognized as an internal or external command, operable progran or batch file. Link to comment Share on other sites More sharing options...
thorkfumble Posted May 7, 2018 Author Share Posted May 7, 2018 (edited) it looks as the space in between Program File won't be recognized. Edited May 7, 2018 by thorkfumble correction Link to comment Share on other sites More sharing options...
Earthshine Posted May 7, 2018 Share Posted May 7, 2018 (edited) so this is a case where you need to make sure it's quoted properly. do it like jos did, I got it to work properly. Edited May 7, 2018 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Developers Jos Posted May 7, 2018 Developers Share Posted May 7, 2018 Try this version please: Run(@ComSpec & ' /k ""C:\Program Files (x86)\path\winscp\winscp.com" /privatkey="C:\Program Files (x86)\path\winscp\ftp_ppk_mm.ppk" "user@host:/data_in" /script="c:\Program Files (x86)\path\winscp\scp_script.txt""') Jos Earthshine 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now