@echo off for/f "skip=3 tokens=4"%%i in ('sc query VMAuthdService') do set "zt=%%i"&goto :next :next if/i "%zt%"=="RUNNING" ( goto stop ) else ( goto start ) pause :stop set /p input=the VMware service is running now ,do you want to stop it? (y or other for yes,n for no,defaultfor y): if/i "%input%"=="n" ( goto :eof ) net stop "VMware Authorization Service" net stop "VMware DHCP Service" net stop "VMware NAT Service" net stop "VMware Virtual Mount Manager Extended" pause goto :eof :start set /p input=the VMware service is stoped now ,do you want to start it? (y or other for yes,n for no,defaultfor y): if/i "%input%"=="n" ( goto :eof ) net start "VMware Authorization Service" net start "VMware DHCP Service" net start "VMware NAT Service" net start "VMware Virtual Mount Manager Extended" pause goto :eof