Update script file for changing file name

Advertisement

murrayb3024
Guest

Update script file for changing file name

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:

# 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

Reply with quote

Advertisement

murrayb3024
Guest

Update script file for changing file name

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.

Reply with quote

Advertisement

You can post new topics in this forum