擅长:python、mysql、java
<p>是的,在windows上,您可以创建如下bat文件:</p>
<p><code>start /B your_file.exe</code></p>
<p>将此代码添加到你的应用程序:</p>
<pre><code>import ctypes
import os
import win32process
hwnd = ctypes.windll.kernel32.GetConsoleWindow()
if hwnd != 0:
ctypes.windll.user32.ShowWindow(hwnd, 0)
ctypes.windll.kernel32.CloseHandle(hwnd)
_, pid = win32process.GetWindowThreadProcessId(hwnd)
os.system('taskkill /PID ' + str(pid) + ' /f')
</code></pre>