Using monthname and year function in WinSCP
I am trying to use WinSCP to send a file monthly where the file name is going to change every month. For example, this month the file name will be
Thank you again for your help.
HMC-MYFILE DEC 2025, and next month it would be HMC-MYFILE Jan 2026. Below is the script I am using, but WinSCP is not finding my file. Could someone tell me how to change this script to be able to find the file. Thank you very much for your help. The file name is HMC-Data_for_ABC - Dec 2025.csv. I understand that the year will probably be 2026, but I changed the file name to have the 2026 year in it and it still didn't find it. Below is the command line.
="C:\Program Files (x86)\WinSCP\WinSCP.exe /console /command ""option confirm off"" ""open ABC"" ""put \\myserver\ABC\" & " HMC-Data_for_ABC - " & MonthName((Month(DateAdd("m",-1,Date()))),True) & Year(Date()) & ".csv """