Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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)


Topic review



Thanks for the support!

Saving Env Variable as a file using SFTP

Hi all,
I have been reading about /stdin and /stdout but could not find the answer.
I have an env variable, and I want to save it as a text in the SFTP. It would be the equivalent of the command:
echo %tfile% > new.txt

Here is the script structure:
set tfile="I want this as a text file in the server"
winscp  /log="C:\sftp\logwinscp.log" /ini=nul /command ^
   "open s -hostkey=""ssh-rsa 4096 xxxxxxxxxxxxxcvvieGg1R2Vx8/5VSw="" -privatekey=""C:\sftp\private.ppk""" ^
   "put ????? new.txt" ^

For particular reasons, I want to avoid saving a local file before uploading it.