Shutting down SER cleanly from batch file
I've posted this already in an old thread which isn't showing up sorry for duplicating it.
https://forum.gsa-online.de/discussion/comment/62715/#Comment_62715
@sven As @kaene said would it be possible to add a command line parameter to close it? It would detect that it's already running, send a close signal to that instance and the instance would do a clean close.
The "GSA_Search_Engine_Ranker.exe -autostart" is great but I have no way of sending WM_CLOSE and don't like the idea of just killing the running program.
Is there any other way to cleanly shut down the GUI?
I need to restart my PC every 8 hours or so and would like to schedule a job to automatically shut down CB and SER / reboot and then restart CB and SER unattended,
A clean shutdown would be nice.
Thank you
Bob
https://forum.gsa-online.de/discussion/comment/62715/#Comment_62715
@sven As @kaene said would it be possible to add a command line parameter to close it? It would detect that it's already running, send a close signal to that instance and the instance would do a clean close.
The "GSA_Search_Engine_Ranker.exe -autostart" is great but I have no way of sending WM_CLOSE and don't like the idea of just killing the running program.
Is there any other way to cleanly shut down the GUI?
I need to restart my PC every 8 hours or so and would like to schedule a job to automatically shut down CB and SER / reboot and then restart CB and SER unattended,
A clean shutdown would be nice.
Thank you
Bob
Comments
it does shut the GUI but pops up the windows error "An error has occurred in the application" and it halts waiting for you to choose continue/restart/close.
Is it possible to prevent this as it stops any further processing (ie backup) - I run Windows XP SP3
ty though @Sven I appreciate it.
closeprocess [process]
Terminates the specified process, by closing its top level windows. As opposed to killprocess command, closeprocess doesn't force the process to be closed immediately. Instead, it send WM_CLOSE message to all top level windows of the specified process. However, be aware that this command will not work on process with no user interface.In the [process] parameter, you can specify the full path of the process filename (e.g: 'C:\Program Files\Internet Explorer\iexplore.exe') or the name of the process only, without the path (e.g.: iexplore.exe). You can also specify the Process ID, by adding the '/' character as a prefix (e.g. /1120).
Examples:
closeprocess iexplore.exe
closeprocess "c:\winnt\system32\calc.exe"
closeprocess /1830
@Sven nearly has it with the -close switch - just needs to stop the windows dialog from popping up
Thank you for taking the time to reply I appreciate it and I didn't know about NirCmd bloody useful little utility.