I'm trying to FTPS a file using scripting and I'm getting this error occasionally and do not understand why. I'm using the following open syntax:
open ftps://userid:password@hostname:21 -passive=on -explicitssl
I've also tried the following with no success:
open ftps://hostname|userid:password@hostname:21 -passive=on -explicitssl
When the error occurs, I get the same error when I manually sign on and execute a stored session using same parameters. Then, all of a sudden, the script starts working. Very frustrating. Any help would be much appreciated.
Very inconsistent, or at least what I percieve. I signed on to remote server and run script - okay. I go back to my laptop and run same script - invalid host name. I sign on manually from laptop - okay. Go back to server - okay. Problem is I can't rely on script working 100% of time.
It looks like some kind of timing or some other conflict issue.
I'm using this to start Winscp:
%pathName%WinSCP.com /log=%pathName%%logfName% /script=%pathName%%scriptName% >>%pathName%%confName%
and this as script:
option batch on
option confirm off
open savedSession (note this is same session that I use to manually sign on)
I was able to login with my desktop earlier. All of a sudden, 'invalid host name' keeps reoccurring. I immediately went to my laptop and executed the same saved session (this saved session is on a networked drive that can be accessed by both laptop and desktop). The first attempt on the laptop failed. I tried again and it worked. I repeated the log-in very quickly (exiting the session each time). I found that it sometimes worked and sometimes did not, as if something on the server to which I am logging on has to be cleared or refreshed. My desktop, however, still does not allow me to log in. Is there some command that I need to include in my log in script to make sure the exit is done properly? It looks like there is some kind of timing or sharing issue. Thanks.