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

gjshuger

I was finally able to track down the cause of this issue - a simple typo in the password. I was confused by the program's output to the console instead of to the log file. Apparently, the log file output doesn't start until a connection is made.

Anyhow, it's working again now.
gjshuger

I was able to successfully transfer files this morning using the GUI process in WinSCP.exe. The WinSCP.com version using batch and script files still doesn't work.

Is there anyone who has an idea why?
gjshuger

Re: WinSCP won't run from batch file

I tried running the command "c:\Program Files (x86)\WinSCP\WinSCP.com ... etc." directly from the Command Prompt and got the same result, i.e., WinSCP seems to start and immediately displays that list of settings on the console instead of outputting them to the specified log file, then displays "Host:" and waits for a response.

I then tried running the batch file in Windows PowerShell and got the same result.

Lastly, I ran the command directly from the command line in PowerShell and got a different result, an error message telling me that I "must provide a value expression on the right-hand side of the '/' operator" referring to the "/ini=nul" clause. I tried running it again without that clause and got the same error, this time referring to the "/log=" clause.

This monthly process ran successfully last month. Here are a couple of lines from the log of that run showing the version:
. 2018-11-19 14:57:12.000 WinSCP Version 5.9.5 (Build 7441) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Enterprise)
. 2018-11-19 14:57:12.001 Configuration: HKCU\Software\Martin Prikryl\WinSCP 2\
gjshuger

WinSCP won't run from batch file

I'm trying to run WinSCP from a batch file created by another application. That app will ultimately run the batch file it creates, but for now I'm running the batch file manually by type its name at a command prompt.

The problem is that WinSCP apparently starts up but, instead of creating the log file and processing the script file, it outputs a few settings and asks for host information. After 10 seconds or so, it quits. I've also tried it without the "/ini=nul" option; the only change is that it makes the "Host:" request twice before quitting.

What have I fouled up?

Here's the command window output from the batch file execution:

V:\>"c:\Program Files (x86)\WinSCP\WinSCP.com" /ini=nul /log="\\<servername>\xxxx\WinSCP_ABC.LOG" /script="\\<servername>\xxxx\<scriptfilename>"
echo off
batch on
reconnecttime 120
confirm off
Host: