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.

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

mibz

After updating to 4.1.6 the problem is solved. The environment-variable is now translated.
Guest

Sorry, forget to mention.

Running WinSCP 4.0.7 on Windows Server 2003.
mibz

%COMPUTERNAME% in script.txt

Hi,

i want to use System-Environment-Variables in my script-file like this:

ftp.bat

winscp.exe /console /script=ftp.txt


ftp.txt

option batch on

option confirm off

# Connect
open ftp://user:passwd@host_ip

# Change remote directory
cd testfolder

# Force binary mode transfer
option transfer binary

# Upload file
put update.log %COMPUTERNAME%.log

# Disconnect
close

# Exit WinSCP
exit


The upload went fine, but the remote-filename is not like expected myhostname.txt but %COMPUTERNAME%.txt so the variable is not translated.

What went wrong?