Guess the service name
Hi all,
the issue: I want to be sure that MySQL daemon is running. I can install MySQL in my own, create the service, then run it with a 'NET mysqlServiceName' command. If MySQL was installed before, I must check the daemon state, and start it if necessary. How can I guess the service name ? Because I can't handle services with sc or NET ... until I know the service name.
I can loop on all the services in the register at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
and check for 'ImagePath' value. If it matches the path that I retrieved before in the installation key of MySQL, I can identify the service targetting the right instpath/bin/mysqld-nt.exe. But it is a long process.
Any good idea from you ?
Thks,
Gal'