Jump to content
thorkfumble

run program within autoit

Recommended Posts

thorkfumble

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

Share this post


Link to post
Share on other sites
thorkfumble

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 by thorkfumble

Share this post


Link to post
Share on other sites
Jos

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 


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Jos

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 by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
thorkfumble

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.

Share this post


Link to post
Share on other sites
thorkfumble

it looks as the space in between Program File won't be recognized. 

Edited by thorkfumble
correction

Share this post


Link to post
Share on other sites
Earthshine

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 by Earthshine

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
Jos

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

  • Like 1

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×