Topic "Update script file for changing file name"

Author Message
murrayb3024

Guest


Our vendor made a change and now we have to modify a script that we have been using for quite some time. Not really sure how to modify it.

What it currently looks like:

Code:
# 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
# Connect
open sftp://xxxxxxxxxxxxxxx -hostkey="xxxxxxxxxxxxxxxxxxx"

# Upload the file to current working directory
option transfer ASCII
put "\\myfilepath\File.txt" -nopermissions -nopreservetime

# Disconnect
close
# Exit WinSCP
exit


What we have to do now is change the filename to FileMMDDYYYY.txt using the current days values. Is there an easy way to do this?

Thanks
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
See similar example:
https://winscp.net/eng/docs/script_download_timestamped_filename
_________________
Martin Prikryl
murrayb3024

Guest


What script language was my example written in (Like I said I didn't build this)?

I know it isn't vbscript or javascript. Hoping I don't have to rewrite this as we just need to append the date but not sure of the syntax to use.
murrayb3024

Guest


Disregard, used a different way of doing. Thanks for taking a look though.
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