Starting/Stoping IMatchWebService by command line

Started by marksnielson, October 09, 2017, 07:00:04 PM

Previous topic - Next topic

marksnielson

Can IMatchWebService be started and stopped via command line or some kind of batch file?  I use the backup copy of IMatch Database for IMatchAnywhere. My scheduled backup of the IMatch Database fails if IMatchWebService is running.  I tried using "Net Stop IMatchWebService" but  got the error "The service name is invalid".  I currently use the latest version of SyncBackFree and it has the capability to run a program before it runs the backup and it can also run a program after the backup.  If I could start and stop IMatchWebService using this capability I believe my backups would work.


Mario

You can start and stop IMatch WebServices from the command line, like any other Windows service.
Many users do that when applying their 'release' workflow to publish a new database. Use the sc command line tool (service controller). See the Windows help for detail.

NET STOP is oooold....

For example, to query the status of IMatch WebServices, use

sc.exe query IMatchWebService

sc.exe stop IMatchWebService
sc.exe start IMatchWebService


You can also stop services easily from a PowerShell command line or script:

stop-service IMatchWebService

You can also write your PowerShell script so that it waits for the service to stop, then backups the database or replaces it with a new version and then starts the service again. Maybe 10 lines of code.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook