Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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

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

Re: Using local environment variables on winscp script

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

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: