Topic "%COMPUTERNAME% in script.txt"

Author Message
mibz

Guest


Hi,

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

ftp.bat

Code:
winscp.exe /console /script=ftp.txt


ftp.txt

Code:

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?
Guest




Sorry, forget to mention.

Running WinSCP 4.0.7 on Windows Server 2003.
mibz

Guest


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

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License