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

noochi01

martin wrote:

noochi01 wrote:

My one additional question is, is there anyway to alter the code above so that it overwrites the log file everytime it runs? Currently it is appending, but I'd rather an overwrite.

There is no command-line parameter for that. You need to configure that in GUI.
https://winscp.net/eng/docs/ui_pref_logging


Thanks Martin! It worked!
martin

noochi01 wrote:

My one additional question is, is there anyway to alter the code above so that it overwrites the log file everytime it runs? Currently it is appending, but I'd rather an overwrite.

There is no command-line parameter for that. You need to configure that in GUI.
https://winscp.net/eng/docs/ui_pref_logging
noochi01

Prikryl,

You are the man. I've seen many responses that you've supplied, and as usual you delivered again. My batch script now works perfectly. Here is the updated code for anyone who needs it..

start "" "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console /script=C:\Users\MYUSERNAME\Desktop\FromFTPServer.txt /log="C:\Users\MYUSERNAME\Desktop\winscplog.txt"

My one additional question is, is there anyway to alter the code above so that it overwrites the log file everytime it runs? Currently it is appending, but I'd rather an overwrite.

Thanks,
Mike
martin

Re: Batch with params failing

Difference may be in a working directory. Try using absolute path to your FromFTPServer.txt.

Regarding the logging: I suppose you are running WinSCP in non-elevated mode, so it won't have write access to C:\Program Files (x86).
noochi01

Batch with params failing

Hi All,

I have read, and read, and read, and read, but I just can't figure this out. I created a simple batch script that launches winscp.exe from a batch file, and passes another file to it with code. This works perfectly everytime because it's in the same directory as winscp.exe. The batch file code is: "C:\Program Files (x86)\WinSCP.exe" /console /script=FromFTPServer.txt Like I said, this works perfectly.

When I create a batch file located on my desktop to perform the same action, it fails to execute correctly everytime. My code from my desktop test.bat file is: start "" "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console /script=FromFTPServer.txt

Can anyone help resolve this? I know it's staring me in the face, but I can't get it right!!! :evil: I would also like to add some sort of log file such as /log="C:\Program Files (x86)\WinSCP\winscp.log.txt" but that failed on me as well.

Any help is greatly appreciated!!!!! :lol: :lol: :lol:

Thanks,
Mike