Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invoking windows batch file from Linux

Tags:

linux

windows

I have an application running only on Windows and a batch file that launches it. I want to invoke this batch file from Linux, meaning something like Linux batch will launch the windows batch with parameters and this in its turn run my application.

Can I do that? How?

like image 262
Ragoler Avatar asked Oct 26 '08 13:10

Ragoler


2 Answers

You could install an ssh server in the windows box (Cygwin has one), then from linux do something like:

ssh user@windows-box c:/path/to/batch.cmd

and that should launch your application in the windows box.

like image 87
dsm Avatar answered Oct 13 '22 21:10

dsm


The most direct way is probably to install an ssh server on the windows box. Cygwin includes an ssh server.

Depending on how precise your timing needs are, you might be able to have an "at" job on the windows box that runs periodically (every 5 minutes?) and runs if it sees that a particular file exists, deleting the file. Then you could use Samba/smbclient to create the file. You would need to turn on filesharing on the windows box for this to work.

If the windows box has a web server, you could write a CGI, and trigger it using wget or cURL.

like image 36
Andru Luvisi Avatar answered Oct 13 '22 21:10

Andru Luvisi