Save the following code in the txt text and change the extension to. bat. When you need to start the mysql service, double-click the. bat file. Double-click it again when it is disabled. @ Echooffforfskip3tokens4 % iin (scquerymysql) dosetzt % igoto: next: nextifi % zt % RUNNING (echo has found this service
Save the following code in the txt text and change the extension to. bat. When you need to start the mysql service, double-click the. bat file. Double-click it again when it is disabled. @ Echo offfor/f skip = 3 tokens = 4% % I in ('SC query mysql') do set zt = % I goto: next: nextif/I % zt % = RUNNING (echo has found this service
Save the following code in the txt text and change the extension to. bat.
When you need to start the mysql service, double-click the. bat file. Double-click it again when it is disabled.
@ Echo offfor/f "skip = 3 tokens = 4" % I in ('SC query mysql') do set "zt = % I" & goto: next: nextif/I "% zt %" = "RUNNING" (echo has found that the service is RUNNING and is shutting down the service net stop mysql) else (echo this service is now processing stopped, enabling the Service net start mysql) exitpause
The mysql character in it corresponds to the name of your MYSQL service. There are 3 in total.