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

murrayb3024

Disregard, used a different way of doing. Thanks for taking a look though.
murrayb3024

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.
murrayb3024

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