Post a reply

Options
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)

Options

Topic review

martin

Again, store the lines from my post to a batch file (e.g. upload.bat). And run the batch file.

Ideally use absolute paths in the batch file (both to the winscp.com and the source local file). Then it would not matter, what directory you store the batch file to.
Guest

Like for example i get into this directory:

C:\Program Files (x86) \WinScp>

and try something like this.. "Open sftp://user:pass@vahud.com"
and nothing happens.. about the only thing I can get to run is simple old dos commands like cd and dir..
Guest

Thanks for the extra info but they question was how and where do I run it. must it be in the Winscp directory with the winscp.exe or the .com.. I assume to run a script i would use the .com..
martin

Re: Best procedure to run a command line script.

This is not a WinSCP script, its a complete batch file:
winscp.com /ini=nul /command ^

    "open sftp://user:password@example.com/ -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" ^
    "get examplefile.txt d:\" ^
    "exit"


So store the above lines to the batch file. You do not need any example.txt.
tommytx

Best procedure to run a command line script.

Please help me out here as I am completely lost. I want to run a command line script and not sure where on the hard drive to put the script.. I made a batch file and an example script and tried that but no workee.. Do I have to find the same directory that winscp.exe is located to place my bat file and example file..
I looked for the c:/Program Files/WinScp/winscp.exe but could not find anything like that on my hard drive.
I do have winscp installed and can use the interface easily and it works well.


Code inside example.txt
winscp.com /ini=nul /command ^

    "open sftp://user:password@example.com/ -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" ^
    "get examplefile.txt d:\" ^
    "exit"


Code inside my batch file.
winscp.com /ini=nul /script=example.txt