Commandline Path with spaces [solved]

Advertisement

poo_noo
Joined:
Posts:
2
Location:
Sydney Australia

Commandline Path with spaces [solved]

Hi all

Forgive me if I have missed something but I have the below code that works
C:\Windows\system32\cmd.exe /c ""C:\Program Files (x86)\WinSCP\WinSCP.exe" /command "option batch abort" "open sftp://user:password@server/ -hostkey=""ssh-rsa myhostkey""" "put D:\PROD.CBA* /remotedir/remotesubdir/" "exit" "    

.... but the code below here doesn't.
C:\Windows\system32\cmd.exe /c ""C:\Program Files (x86)\WinSCP\WinSCP.exe" /command "option batch abort" "open sftp://user:password@server/ -hostkey=""ssh-rsa myhostkey""" "put D:\D:\Fiserv Reports\Data\Output\CBA\NSW\PROD.CBA* /remotedir/remotesubdir/" "exit" "    

Could someone advise how to wrap the path with a space in it? I have tried multiple variations but without success.

Note: I am calling this via a AutoHotkey script. Thanks in advance

Last edited by poo_noo on 2014-04-17 01:56; edited 2 times in total

Reply with quote

poo_noo
Joined:
Posts:
2
Location:
Sydney Australia

I was able to work it out. I switiched from winscp.exe to winscp.com and was able to call it from AutoHotkey

; all the SFTP function
RunWait, 
(LTrim Join`s 
%ComSpec% /c ""%path2WINscp%" /command "option batch abort"
"open sftp://%user%:%pass%@%server%/ -hostkey=""%host_key%""" 
"%ftp_cmd% ""%local_path%"" %remote_path%" "exit" 
),,hide UseErrorLevel    

Reply with quote

Advertisement

You can post new topics in this forum