我写了一个Windows应用程序,现在我想把它转换成Windows服务。在我的Windows服务程序中,我有一个打开批处理文件的线程。通常我使用Shell Execute打开批处理文件:
ShellExecute(Handle, 'open', PWideChar('myPath'), nil,nil, SW_Hide);但是我不能在我的线程中使用SW_Hide。有没有其他方法在线程中打开批处理文件,或者我使用的方法是正确的吗?
发布于 2020-10-05 20:09:26
是否有在线程中打开批处理文件的其他方法
您可以通过以下命令行打开批处理文件:
cmd.exe /c mybatch.bat arg1 arg2 arg3您可以使用Windows API CreateProcess从您的线程启动它。
https://stackoverflow.com/questions/64207771
复制相似问题