Forum Discussion
AlexKaras
14 years agoChampion Level 3
Hi Nikita,
This will work indeed. But with one possible problem. ;)
The case is that 'sc stop' (or 'net stop') returns as soon as the relevant code in the stopped service exits. But depending on the service, the actual process might be running sor some more time. For example, for the Firebird database service the 'net stop' returns quickly, but the processes will be running for quite a long time until all tasks are completed/postponed and database files are closed. In this case I would recommend a loop (with optional timeout) to wait until the service's process is closed.
This will work indeed. But with one possible problem. ;)
The case is that 'sc stop' (or 'net stop') returns as soon as the relevant code in the stopped service exits. But depending on the service, the actual process might be running sor some more time. For example, for the Firebird database service the 'net stop' returns quickly, but the processes will be running for quite a long time until all tasks are completed/postponed and database files are closed. In this case I would recommend a loop (with optional timeout) to wait until the service's process is closed.
Related Content
- 13 years ago
Recent Discussions
- 13 hours ago
- 2 days ago