Using local environment variables on winscp script

Advertisement

Aslam
Guest

Using local environment variables on winscp script

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. :cry:

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: Using local environment variables on winscp script

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

Reply with quote

Aslam
Guest

Re: Using local environment variables on winscp script

martin 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.

Reply with quote

martin
Site Admin
martin avatar

Re: Using local environment variables on winscp script

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.

Reply with quote

Advertisement

You can post new topics in this forum