简体   繁体   English

通过javascript从本地系统执行位于远程服务器中的批处理文件

[英]execute a batch file located in remote server from local system via javascript

I have a batch file which is located in remote system. 我有一个位于远程系统中的批处理文件。 The batch file will be executed along with the arguments which I will pass from javascript. 批处理文件将与我将从javascript中传递的参数一起执行。 Is it possible to execute that batch file from local system using javascript ? 是否可以使用javascript从本地系统执行该批处理文件? I will be having full access details of the remote system. 我将获得远程系统的完整访问详细信息。

I researched on net that it can be done using PsExec but how to use it via javascript ? 我在网上进行了研究,可以使用PsExec完成此操作,但是如何通过javascript使用它呢?

In nodejs you can run PsExec using child_process.spawn() . 在nodejs中,您可以使用child_process.spawn()运行PsExec。

Here's an example: Using PsExec with spawning a child process results in truncated stdout 这是一个示例: 使用PsExec生成子进程会导致标准输出被截断

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM