Joined:
Posts:
2
Location:
Saginaw, MI

I am trying to make it so that when the task is ran WinSCP automatically can log me in > grab files from specific folders > then push them out to others.

Right now I am trying to figure out a script that will log me in to the system. When I open WinSCP on my own it automatically fills out the login information that I need so all i need it to do is press the login button then I can move onto the next problem of moving the files.

Thank you in advance if anyone can help me figure this out. :lol:

Joined:
Posts:
2
Location:
Saginaw, MI
This is the login screen that I get when WinSCP is opened every time so I need it to automatically press the login button for me since everything is already filled out

Guest

So this is the code that WinSCP generated for me with the personal information *'ed out.

When I run the batch file it says,
Connecting to sftp.******.com ...
Connected
Starting the session...
Session started.
Active session: [1] **********@sftp.****.com
Success

And then after this it just closes and nothing else happens.
Any ideas on how I can move forward with this problem?

Thanks

@echo off

"C:\Program Files\WinSCP\WinSCP.com" ^
/log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^
/command ^
"open ftp://**************:***********@sftp.******.com/" ^
"exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)

exit /b %WINSCP_RESULT%

Guest

## OK So....

In Task Scheduler I have it opening WinSCP, then in the arguments part I inserted the ftp:// with where I want to connect to.
It opens up correctly, but I am in the wrong directory for the documents I need to upload.

Is there a way to in the arguments put me in for example the S Drive on my PC?
Or is there a way to just upload straight from where I want to take the documents from and upload them without being in the correct drive?

Thanks

martin

## Re: OK So....

Sure, you can use a full path in the put command, like put S:\*.* /remote/path/. Or use the lcd command before the upload, like lcd S:\ ... put *.* /remote/path/. Again, that's what the generated script does for you already, had you used the correct directories to generate it!