Topic "Scripts can use env variables"

Author Message


I suggest documenting better the fact that we can now (as of some version between 3.8 and 4.1.Cool use %envvar% inside WinSCP scripts. All I found was it used in some example scripts. The main "script" page should have added somthing like:

You can use environment variables inside scripts similar to the way you can inside Windows batch files. Use the form %var1% in the script file and it will be replaced when the script is running by the current value of the environment variable "var1". You can set environment variables from the Windows command line with the command "set var1=\files\file1.txt" or they can be set from the system control panel. Click "Advanced" tab then the "Environment Variables" button and you can add and modify values. Note that the values you set under the control panel editor become active when you open a new DOS box but the "set" command causes instantaneous changes.

Or something like that. Maybe an example with a batch file and a script would make it clearer.

-- Lee
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25310
Location: Prague, Czechia
This is documented on a beginning of scripts commands section.
Martin Prikryl

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License