从* nix中执行远程Windows计算机上的EXE或BAT文件 [英] Executing exe or bat file on remote windows machine from *nix

查看:459
本文介绍了从* nix中执行远程Windows计算机上的EXE或BAT文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图执行从我的Linux云远程Windows机器上的一个bat文件。蝙蝠文件启动硒服务器,然后我硒测试运行。我不能够到该计算机上启动硒RC服务器。我试图用远程登录,但它存在的问题是,当telnet会话被关闭RC服务器的端口也被关闭。正如我的code $我的C $ c的,所以我用ANT任务的telnet和telnet也执行shell脚本中左右逢源的端口关闭试图启动服务器。

I am trying to execute a bat file on remote windows machine on cloud from my Linux. The bat files starts selenium server and then my selenium tests are run. I am not able to start selenium RC server on that machine. I tried with Telnet but the problem with it is when telnet session is closed the RC server port is also closed. As my code my code has to start the server so I tried with ANT telnet task and also executed shell script of telnet in both ways the port was closed.

我读到关于开放SSH,PSEXEC用于Linux和Cygwin。但我没有得到如何使用这些的时候,就会将解决我的问题。

I read about Open SSH, psexec for linux and cygwin. But i am not getting how to use these and will they will solve my problem.

我曾试图启动,这将启动服务器,但在这种方法我没有得到浏览器中查看所有测试的背景,我的脚本运行的服务需要截屏浏览器能见度必须的。

I have tried to start a service which will start the server but in this method i am not getting browser visible all tests are running in background as my script takes screen shot browser visibility is must.

现在我的问题是用什么,这将是我的工作preferable。
曾经和我选择应该由$ C $执行什么C也可能是由外壳,蚂蚁或php。

Now my Question is what to use and which will be preferable for my job. and what ever i choose should be executed by code it may be by shell, ant or php.

先谢谢了。

推荐答案

我preFER使用Cygwin和使用SSH然后登录到Windows机器上执行命令。要知道,在默认情况下,cygwin没有安装OpenSSH的。

I prefer to use cygwin and use SSH to then log in to the windows machine to execute commands. Be aware that, by default, cygwin doesn't have OpenSSH installed.

一旦你有SSH工作在Windows机器上你可以从Linux机器上像这样运行命令:

Once you have SSH working on the windows machine you can run a command on it from the Linux machine like this:

ssh user@windowsmachine 'mycommand.exe'

您还可以设置 ssh认证键,以便你不需要输入每次都输入密码。

You can also set up ssh authentication keys so that you don't need to enter a password each time.

这篇关于从* nix中执行远程Windows计算机上的EXE或BAT文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆