用 Python 脚本多线程方式执行多个 bat
import threading
from win32api import *
class MyThread(threading.Thread):
def __init__(self, bat_path, **kwargs):
threading.Thread.__init__(self, **kwargs)
self.bat_path = bat_path
def run(self):
ShellExecute(0, None, self.bat_path, None, "c:\\", True)
for i in range(1,4):
t = MyThread("c:\\test" + str(i) + ".bat")
t.start()
from win32api import *
class MyThread(threading.Thread):
def __init__(self, bat_path, **kwargs):
threading.Thread.__init__(self, **kwargs)
self.bat_path = bat_path
def run(self):
ShellExecute(0, None, self.bat_path, None, "c:\\", True)
for i in range(1,4):
t = MyThread("c:\\test" + str(i) + ".bat")
t.start()
浙公网安备 33010602011771号