Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Re: Multiple commands on one line in a batch file

The command line (for any application) is actually one-line only always.

Only in Windows batch files you can visually break that one line into multiple lines by delimiting the "new line" with the ^.

The ^ is not WinSCP syntax, it's a batch file syntax. WinSCP never sees the ^.

So your batch file actually executes this command-line:
"C:\Program Files (x86)\WinSCP\" /command "open"    "cd /\STRATEGY\" "lcd ""C:\Users\Mark Dullingham\Documents\Backup Test""" "get L030N014.IQ3" "exit"

And that answers your question.

Multiple commands on one line in a batch file

Hi all

I want to make it easier for some of mu colleagues to write a site specific batch file to retrieve some files. We have the ability to export some details in to excel and I can ther3efore get excel to insert the relevant info in to a long text string.

For this to work I need ALL of the commands in the following code to be on one line.
"C:\Program Files (x86)\WinSCP\" ^
  /command ^
    "open" ^
    "cd /\STRATEGY\" ^
    "lcd ""C:\Users\Mark Dullingham\Documents\Backup Test""" ^
    "get L030N014.IQ3" ^

I think it has something to do with the ^ symbol but I'm not sure how to remove this or does it need to be replaced by another symbol.

Any help much appreciated.