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

Omit both start and cmd.exe. This way you are redirecting output of start command, which has none.
farmerBill

PS

Sorry I didn't answer your post completely. It creates an empty file. The FTP commands work ok. Same behavior with "CMD.EXE" omitted.
farmerBill

(VISTA .bat file):

@echo off
start "cmd.exe /A WinSCP" "C:\Program Files\WinSCP\WinSCP.com" /command ^

"open student@localhost" ^
"cd /home/student/asas" ^
"pwd" ^
"put abc.txt" ^
"ls" ^
> hw3updat.scriptlog
martin

Re: Logging terminal output

farmerBill wrote:

winscp.com /command "..." "..." > out.txt

does not work. Any ideas?

And what does it do? Where do you run the command from?
farmerBill

Logging terminal output

winscp.com /command "..." "..." > out.txt

does not work. Any ideas?
martin

You need to run the command via intepreter (cmd.exe) to allow output redirection from "run" dialog.
xpcommon

i ll see it later
martin

Re: How to redirect terminal output of winscp3.com to file

Kaydet81 wrote:

This works fine from a command prompt but does not work well from my program (with appropriate escapes for "\") or the Windows "Run" dialog. The Run dialog produces the same results as my program - I get a console window that prompts for a user name, shows some errors, and does not redirect output.

I'll try that. I never did.
Kaydet81

Re: How to redirect terminal output of winscp3.com to file

martin wrote:

You can only redirect whole session:
winscp.com /command "open user@host" "ls" > output.exe


I am trying to call WinSCP from a Visual C++ 6 program using CreateProcess. The resultant command line is something like:
"C:\Program Files\WinSCP3\WinSCP3.com" /script=C:\TEMP\SCR1.tmp > C:\TEMP\SCR2.tmp 2>&1

This works fine from a command prompt but does not work well from my program (with appropriate escapes for "\") or the Windows "Run" dialog. The Run dialog produces the same results as my program - I get a console window that prompts for a user name, shows some errors, and does not redirect output.

For context, my VC6 program's purpose is to get files from source control (PVCS) and push them out to the server with WinSCP in a seamless fashion. I need to capture output to know the nature of errors that may occur.

Thank you.
martin

Re: How to redirect terminal output of winscp3.com to file

You can only redirect whole session:
winscp.com /command "open user@host" "ls" > output.exe
TN

How to redirect terminal output of winscp3.com to file

Hello there I got a question, is it possible to redirect the output of winscp3 command shell promt into file? I would like to generate files with the content of my directories. I tried to use ls > list.txt, but it doesn't work win winscp3.com command shell. Can anybody help?