I wrote a Windows Application and now I want to transform it into a Windows Service. In my Windows Service Program I have a thread which should open a batch file. Normally I open batch files with Shell Execute:
ShellExecute(Handle, 'open', PWideChar('myPath'), nil,nil, SW_Hide);
But I can not use SW_Hide in my thread. Is there any other way opening a batch file in a thread or am I using the correct approach?
You can open a batch file by the following command line:
And you can start this from your thread using Windows API
CreateProcess
.