代码:
 
@echo off
if "%1" == "stop" goto stop
if not "%1" == "start" (
   echo useage as %0 start/stop
   pause
   goto end
)
if "%2" == "background" goto background 
 rem mshta vbscript:createobject("wscript.shell").run("%~nx0 %1 background",0)(window.close)&& exit
 mshta vbscript:createobject("wscript.shell").run("%~nx0 %1 background",0)(window.close) 
  echo start over
 goto end
:background
if "%1" == "start" (
 goto start 
) else if "%1" == "stop" (
 goto stop
)
echo "use as %1 start/stop"
pause
goto end
  
:start 
mysqld
goto end
:stop
taskkill /F /IM mysqld.exe
pause
:end