%COMPUTERNAME% in script.txt

Advertisement

mibz
Guest

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

Reply with quote

Advertisement

You can post new topics in this forum