Calling a Windows batch file from Linux

I have an application that runs only on Windows and a batch file that runs it. I want to call this batch file from Linux, which means that the Linux package launches the Windows package with the parameters, and this, in turn, launches my application.

Can I do it? How?

+6
linux windows
source share
6 answers

You can install the ssh server in a Windows window (Cygwin has one), then from linux do something like:

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

and this should launch your application in a window window.

+11
source share

The most direct way is probably to install an ssh server in a window window. Cygwin includes an ssh server.

Depending on how accurate your time needs are, you may have the β€œat” task in the window window that runs periodically (every 5 minutes?) And runs if it sees that a particular file exists by deleting the file. Then you can use Samba / smbclient to create the file. To do this, you will need to enable file storage in the window window.

If there is a web server in the window, you can write CGI and run it using wget or cURL .

+1
source share

Our build process is currently going in the opposite direction: the Windows segment runs everything on a Linux server using plink (part of PuTTY ). You might be able to install something similar.

0
source share

This may cause a security problem. Our information security specialist did not allow me to directly refer to any programs.

It is safest to configure the server on a Windows computer. For example, it could be a web server. And then call your process inside a PHP / Perl / Python script.

0
source share

Also see winexe , which allows you to execute Windows commands / batch scripts without starting an ssh server.

0
source share

There is a way to run batch files on Linux directly. This article explains how ( http://www.linux.org/threads/running-windows-batch-files-on-linux.7610/ ).

-one
source share

All Articles