Topic "Use of environment variables in the GUI or command line"

Author Message
sreerao
[View user's profile]

Joined: 2012-08-14
Posts: 2
Hi,
Is it possible to use common windows environment variables in the GUI (Graphical User Interface) or the command-line. E.g., I would like to publish the WinSCP application (portable) as a RemoteApp, and would like to pass the %username% as a variable in the session. Is this possible?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
You can use environment variables in some GUI fields (such as hostname and username) with 5.x, see documentation:
https://winscp.net/eng/docs/ui_login

You can also use variable in WinSCP scripts.

On command-line, variables are expanded by Windows, in you run WinSCP from .bat file.
_________________
Martin Prikryl
sreerao
[View user's profile]

Joined: 2012-08-14
Posts: 2
Thanks. This is exactly what I was looking for.
Your hint about the batch scripts did work as well. I tested with winscp.exe scp://%username%@hostname.address /rawsettings AuthGSSAPI=1 /hostkey="ssh-rsa 2048 asdfma.fdm.amf.amd.fma.dmf.amdf.,adfd" and it worked really well.
I need to find a way to restrict the menu settings, so that the users see a restricted UI.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
sreerao wrote:
I need to find a way to restrict the menu settings, so that the users see a restricted UI.

There's no easy way to do that.
_________________
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