Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

martin

Re: Do you refer to the .js file when running it from SSIS?

mikedu wrote:

Executable: C:\Program Files\WinSCP\WinSCP.com
Arguments: -script=C:\download.js
Working directory: C:\Program Files\WinSCP

.js is WSH script, not WinSCP script
https://winscp.net/eng/docs/guide_automation_advanced#wsh
mikedu

I added another line

just trying to rename the file with today's date using script commands and it didn't work.

mv CDS_STAGE.txt %date:~4,2%-%date:~7,2%-%date:~10,4%.txt
mikedu

Do you refer to the .js file when running it from SSIS?

I called it from my execute process task in ssis and it gave me a ton of errors...sorry I am a newbie to this...

I referenced the .txt file in the arguments line, so I replaced it with the example file (see below)

Executable: C:\Program Files\WinSCP\WinSCP.com
Arguments: -script=C:\download.js
Working directory: C:\Program Files\WinSCP
Mikedu

Renaming file after downloading with today's date?

Hi, I am using WinSCP for SFTP and it is working beautifully. I reference a txt file (see code below) and I call if from an SSIS package. The last thing I want to do is rename the source file to filename_todaysdate.txt. I have tried %date% but it just puts %date% in the filename, not the actual date. Any suggestions would be appreciated...

# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
open login:pwd@IPAddress:Port
# Change remote directory
cd /home/emppfu/downloads
# Force binary mode transfer
option transfer binary
# Download file to the local directory d:\
get CDS_STAGE.txt "\\Entp14\empgroup\BSG\CDS Balancing\ToBeProcessed\"
# Disconnect
close
# Exit
exit