简体   繁体   English

Python:通过网络执行bat文件

[英]Python: Execute bat file via Network

I am trying to execute a bat file which is stored on a different machine on my network and I want this file to be executed on the machine on which it is stored. 我正在尝试执行一个bat文件,该文件存储在网络上的另一台计算机上,并且我希望在存储该文件的计算机上执行该文件。

Ie, Say I am using PC "A" and I have a bat file on PC "B" & "C". 即,假设我正在使用PC“ A”,并且在PC“ B”和“ C”上有一个蝙蝠文件。 Now I want to have a python script which will allow me to select the machine via UI (later), ie "A" or "B" and then execute the script stored the network machine. 现在,我想拥有一个Python脚本,该脚本允许我通过UI(以后)(即“ A”或“ B”)选择计算机,然后执行存储在网络计算机中的脚本。

Is there a way to do that in Python? 有没有办法在Python中做到这一点?

Thanks in advance 提前致谢

Try using PsExec . 尝试使用PsExec It's standalone but probably can be launched from Python 它是独立的,但可能可以从Python启动

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

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