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