优化程序

This commit is contained in:
hero920103 committed 2026-10-12 14:57:46 +08:00
1 parent 68e8eb91a7
commit 6df29c9254
27 files changed
+1974 -203

No files matched your search

+5 -16
View File
@@ -3,7 +3,6 @@
"""
import os
import subprocess
import tempfile
from PyQt6.QtWidgets import (
QDialog, QVBoxLayout, QHBoxLayout, QLabel, QLineEdit,
@@ -203,22 +202,12 @@ class WechatMultiDialog(QDialog):
database.set_setting(_DB_KEY_PATH, exe)
database.set_setting(_DB_KEY_COUNT, str(count))
# 写临时 bat,连续 start 多次
lines = ["@echo off"]
# 直接多次启动,避免 bat 文件中文路径编码问题
for _ in range(count):
lines.append(f'start "" "{exe}"')
bat_content = "\r\n".join(lines) + "\r\n"
tmp = tempfile.NamedTemporaryFile(
delete=False, suffix=".bat", mode="w", encoding="gbk"
)
tmp.write(bat_content)
tmp.close()
subprocess.Popen(
["cmd", "/c", tmp.name],
creationflags=subprocess.CREATE_NO_WINDOW
)
subprocess.Popen(
[exe],
creationflags=getattr(subprocess, "CREATE_NO_WINDOW", 0),
)
self.accept()
# 无边框拖动