Loading Wine from Terminal

Questions about applications and software
Forum rules
Before you post please read how to get help
Level 1
Level 1
Posts: 22
Joined: Fri Jul 20, 2012 3:06 pm

Loading Wine from Terminal

Postby tcotariu » Tue May 07, 2013 5:58 pm

Loading Wine from Terminal

If this has already been asked, I am sorry. I could not find anything on it.

I am looking for a command line for running programs under wine. The one I am specifically trying to get going right now is Putty. Yes, there is a version of Putty that runs natively under Linux, and I have it, but it has problems with copy and paste. I also know that I can right click on putty.exe and tell it to Open With the Wine Windows Program Launcher. This works fine, but I can not use any command line parameters when I start it that way.

What I really want is to start Putty with the following script line (this is what I do for the Linux version, but it has problems with copy and paste).

(putty -ssh $1 -l manager -pw $2 &)

This will allow me to use command line arguments for the IP Address and password for the device that I am connecting to via SSH. If I was just connecting to one, or even two, devices I would be happy to open it by right clicking on putty.exe and telling it to Open With the Wine Windows Program Launcher. However, I typically have to go in and out of several, sometimes as many as 20+, devices in each session and this allows me to quickly do an up-arrow within the terminal and just change the IP Address for each successive device. Much quicker, and easier, than opening the Putty Configuration page and entering in everything manually for each device I connect to.

Anyway, I have been unsuccessful finding anything on this here, or at winehq.org, and I was hoping that somebody might be able to point me in the right direction.


User avatar
Level 17
Level 17
Posts: 7949
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Loading Wine from Terminal

Postby karlchen » Tue May 07, 2013 6:24 pm

Hello, tcotariu.

Irrespective of the question what may be wrong with using gnome-terminal on Linux Mint, I suggest this approach to achieve your goal:

(to make explaining easier)
+ your Wine folder is /home/tcotariu/.wine
+ among other things it holds the folders dosdevices and drive_c
+ the Windows Putty software has been installed in the folder /home/tcotariu/.wine/drive_c/Program\ Files/Putty

Suggested script:
In order to pass the parameters $1 and $2 on the commandline in an easy and convenient way I suggest to create a short shell script wputty.sh

Code: Select all

if [ "$2" = "" ]
    echo "Usage: `basename $0` arg1 arg2. - Try again, please."
    exit 1
wine "/home/tcotariu/.wine/drive_c/Program Files/Putty/putty.exe" -ssh $1 -l manager -pw $2

Suggested commandline:

Code: Select all

/path/to/wputty.sh arg1 arg2
where you replace "arg1" and "arg2" by the appropriate strings.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Return to “Software & Applications”

Who is online

Users browsing this forum: No registered users and 12 guests