Password Prompt while scripting

Advertisement

F. den Blaauwen
Guest

Password Prompt while scripting

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?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: Password Prompt while scripting

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?

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.

Reply with quote

F. den Blaauwen
Guest

Re: Password Prompt while scripting

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]

Reply with quote

F. den Blaauwen
Guest

Re: Password Prompt while scripting

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.

Reply with quote

martin
Site Admin
martin avatar

Re: Password Prompt while scripting

OK, I'll think about it. But I wonder why would you try to run script using stored session with wrong password?

Reply with quote

Advertisement

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

Reply with quote

Maher
Guest

Re: Password Prompt while scripting

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.

Reply with quote

Advertisement

You can post new topics in this forum