Topic "Scripting Help for Simple Upload"

Author Message
jmcknight00
[View user's profile]

Joined: 2016-01-27
Posts: 7
Location: Juneau, AK
Hi, I am new to Winscp and am trying to automate a very simple upload to a remote server. I have created a .bat file and a .txt file to execute the script. I'm having trouble with the script file. Currently I have this:

Open sftp://<username>:<password>@bloomberg.com/
Put "c:\home\bbdumps\f2226icsh.inc" /log=c:\home\bbdumps\sftplog.txt
exit

The Winscp window opens and says "searching for host" but nothing else happens. So obviously it is not recognizing the syntax I used to open the sftp site and verify user name and password. I am successfully uploading this file manually via drag and drop from Winscp.

Any help would be appreciated highly! James
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
The /log=c:\home\bbdumps\sftplog.txt parameter must be on WinSCP command-line (along with /script=....), not in put command.

Once you fix that, attach the log file here.
jmcknight00
[View user's profile]

Joined: 2016-01-27
Posts: 7
Location: Juneau, AK
prikryl wrote:
The /log=c:\home\bbdumps\sftplog.txt parameter must be on WinSCP command-line (along with /script=....), not in put command.

Once you fix that, attach the log file here.



I uploaded the log file. Thanks for looking!
sftplog.txt (3.48 KB) [Download]

Description: (none)

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Thanks. Show us a log file from GUI for a comparison.
jmcknight00
[View user's profile]

Joined: 2016-01-27
Posts: 7
Location: Juneau, AK
prikryl wrote:
Thanks. Show us a log file from GUI for a comparison.


Hi, I'm sorry, I don't know what GUI is. Do you mean a log file from the old ftp batch?
Thanks...

James
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
No I mean a log file for "uploading this file manually via drag and drop from Winscp."
jmcknight00
[View user's profile]

Joined: 2016-01-27
Posts: 7
Location: Juneau, AK
prikryl wrote:
No I mean a log file for "uploading this file manually via drag and drop from Winscp."



Sorry, I have attached the manual log file. Thanks again!

James
upload.log (15.55 KB) [Download]

Description: (none)

jmcknight00
[View user's profile]

Joined: 2016-01-27
Posts: 7
Location: Juneau, AK
OK, I just changed my script to:

Open sftp://<username>:<password>@sftp.bloomberg.com/
Put "c:\home\bbdumps\f2226icsh.inc" /log=c:\home\bbdumps\sftplog.txt
exit


I added the sftp.bloomberg.com and it looks like it is really close to working now. I attached the new log showing that everything worked with the exception of the password. Do I need to add quotes around the password or something?

Thanks for all your help!
James
sftplog.txt (5.28 KB) [Download]

Description: (none)

jmcknight00
[View user's profile]

Joined: 2016-01-27
Posts: 7
Location: Juneau, AK
I forgot to mention that there is a special character in the password. It is a + sign. Would throw off the script?

James
jmcknight00
[View user's profile]

Joined: 2016-01-27
Posts: 7
Location: Juneau, AK
I finally figured out it was the + sign that was throwing it off.

I replaced the + sign with %2B and it is now successfully uploading my file.
Thanks for your help.


James
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