Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling WinSCP.exe from script

Status
Not open for further replies.

Spence32

Programmer
Sep 29, 2008
4
CA
Hi,

In my script I am trying to call WinSCP by using:

system("WinSCP.exe /script=$workDir\\$tempScpFileName");

But the error returned is

'WinSCP.exe' is not recognized as an internal or external command, operable program or batch file.

WinSCP is installed on my machine at C:\Program Files\WinSCP

Is there something I should be doing differently?

Thanks
 
Thanks, that was it. I tried that before, but it threw an error on the space in the path name between Program and Files so I moved the executable to C: directly it and worked.

By the way, how would I use the full path name which included spaces, is there a wild card I could use?

Thanks
 
Hi

Oops. Sorry. I missed the space. This two should do it :
Code:
system("C:\\Program[red]\\[/red] Files\\WinSCP\\WinSCP.exe /script=$workDir\\$tempScpFileName");

[gray]# or[/gray]

system("[red]\\\"[/red]C:\\Program Files\\WinSCP\\WinSCP.exe[red]\\\"[/red] /script=$workDir\\$tempScpFileName");

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top