Topic "Password Prompt while scripting"

Author Message
F. den Blaauwen

Guest


I've been busy using scripting and I have encountered 2 problems:

1 While in console mode, when the password is not right, you must enter a password. In a script this is not handy, cause is would run unattended. Yes option prompt off, and yes again option batch on.

2 When the console is started using winscp3.com, the errorlevel is 0 when the password is not right. (For now entered manually: see problem 1). A possible workaround is using winscp3.exe /console but this opens a new console-box.

Can someone help me on this, or are this plain bugs?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
F. den Blaauwen wrote:
1 While in console mode, when the password is not right, you must enter a password. In a script this is not handy, cause is would run unattended. Yes option prompt off, and yes again option batch on.

I do not understand this. You mind that you are asked for password second time if you enter wrong one the first time?

Quote:
2 When the console is started using winscp3.com, the errorlevel is 0 when the password is not right. (For now entered manually: see problem 1). A possible workaround is using winscp3.exe /console but this opens a new console-box.

Good point. Error level is not propagated to .com from the .exe. I'll fix it in the next release.
_________________
Martin Prikryl
F. den Blaauwen

Guest


I run the following script test.s with the command winscp3 /console /script=test.s
The user someuser@somesite.nl has been saved with a password in 'stored sessions'. When I use the right password, no userintervention is needed, when the password is wrong, the console prompts for a password (and waits for ever when the user does nothing)

[script starts here]
option batch on
option confirm off
open someuser@somesite.nl
option transfer binary
put somefile
close
exit
[script ends here]
F. den Blaauwen

Guest


Sorry, I forgot to answer your question.

Yes I do mind the console asking, cause when I use a script, I use it unattended. I would like to have WinSCP to terminate and return errorlevel 1. The batchfile calling WinSCP can send a mail to the administrator that the upload didn't work.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
OK, I'll think about it. But I wonder why would you try to run script using stored session with wrong password?
_________________
Martin Prikryl
F. den Blaauwen

Guest


It is not that I like to use the wrong password, but the password has changed on the ftp-server. But I've found a good workaround using pscp.

Thanks for the replies and keep up the good work
Maher

Guest


F. den Blaauwen wrote:
1 While in console mode, when the password is not right, you must enter a password. In a script this is not handy, cause is would run unattended. Yes option prompt off, and yes again option batch on.


I'm having the same problem. I need the application to end if an incorrect password is passed within a script, I am running in console mode as a windows process and I don't want to leave the process running.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License