Execute Shell Commands from Program running in WINE

With newer Wine versions (tested with Wine 1.7.38), you can run a Linux program from within Wine in the following way (here to launch gedit, as an example):

wineconsole cmd

...and from that wine console:

start /unix /usr/bin/gedit

If you want to launch a Linux program directly from within a Windows-application, the following line did work for me:

cmd /c start /unix /usr/bin/gedit

To test this, you can call directly on your Linux console this:

wine cmd /c start /unix /usr/bin/gedit

One important thing to Note: the program you want to start needs to have the executable bit set, otherwise calling it from Wine will fail!


Try this (runs Gnome calculator on my Linux Mint system):

wineconsole cmd

...and from the wine console:

/bin/sh gcalctool

On this general principle, you can also open documents and associate files with a linux app by editing the wine registry. There is a section about it in the wine FAQ:

6.6.3 How do I associate a native program with a file type in Wine?

So you should be able to write shell scripts and call them OK.

Tags:

Linux

Shell

Wine