在远程服务器上执行批处理文件 [英] Executing batch file on Remote server

查看:404
本文介绍了在远程服务器上执行批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在D盘上的服务器上有一个批处理文件。



我有一个.net windows应用程序,我想在服务器上执行该批处理文件。



我已经尝试过process.start方法,但执行发生在我的机器上。我不希望该批次在我的机器上执行,而是希望它在服务器上执行。





有些人可以帮助我提供相同的代码。





提前致谢。

Hi All,

I have a batch file on my Server on D drive.

I have a .net windows application and i want to execute that batch file on server itself.

I have tried process.start method but the execution happens on my machine. i don't want that batch to execute on my machine instead i want it to execute on server itself.


Can some help me providing the Code for doing the same.


Thanks in advance.

推荐答案

Refer-



1. 使用C#中的WMI创建远程进程 [ ^ ]。



2. 如何在远程服务器上执行bat文件? [ ^ ]

Refer-

1. Create a Remote Process using WMI in C#[^].

2. How to execute a bat file on remote server?[^]
引用:

你可以使用 PsExec 。我用它来执行批处理文件并将参数传递给它们。

You can execute commands on remote machines using PsExec. I use it to execute batch files and pass parameters to them.


这篇关于在远程服务器上执行批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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