Topic "Using local environment variables on winscp script"

Author Message
Aslam

Guest


Hi Martin,

I am using WinSCP to connect to a server which is running OpenSSH. I use a script which is specified with /script option to winscp3.com. Both the local and remote are Windows 2000 box. My script looks like this:

option batch on
option confirm off
mkdir /home/test/$HOSTNAME
cd /home/test
put c:\test\*.zip
close
exit

The session (Test) is already stored in INI file as I have made the INI as storage rather than Registry. When Winscp3 is executed with the options like:
winscp3 Test /console /script=test.txt
It starts up the session, connects to the server but creates a folder as $HOSTNAME itself. I tried with $HOSTNAME, $COMPUTERNAME, %COMPUTERNAME% but it doesn't seem to work out. Need your help on this please. Crying or Very sad
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Do you really mean local (client-side) variables, not remote (server-side) variables?
_________________
Martin Prikryl
Aslam

Guest


prikryl wrote:
Do you really mean local (client-side) variables, not remote (server-side) variables?


Yes... my requirement is like this: I have a central server which is installed with OpenSSH. I have 30 clients which needs to transfer files to the server. When transfer initiated, the clients needs to put the files in the respective folders created with their names like Client1, Client2, etc (The names of the clients). clients will only use WinSCP. I'm trying a possible way to use an environment variable so that I need not have to key in the server names on all the clients which will deteriorate the implementation time. Thanks for your reply.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Aslam wrote:
I'm trying a possible way to use an environment variable so that I need not have to key in the server names on all the clients which will deteriorate the implementation time. Thanks for your reply.

You can generate the WinSCP script file using a batch file.
_________________
Martin Prikryl
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