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

ChadB

Got it for now

Thank you Martin. I wasn't able to actually transfer files with my permissions so I never saw the generate code part.

Sorry for the continued questions :wink:

The answers were helpful though for me to get where I needed to go and continue to search around. If I run into any more problems I will let you know.

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!
Chad

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
Chad

Follow Up

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%
martin

Re: Task Scheduler/Automation Scripting Question

You do not want to automate the GUI ("click a button"), you need to write a script.

You can have WinSCP GUI generate the script for you (even for the transfer, not just the login):
https://winscp.net/eng/docs/guide_automation#generating
ChadBtz

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
ChadBtz

Task Scheduler/Automation Scripting Question

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: