I want to run bat file in mysql prompt automatically in all computers without setting environment variable path.
I am using Xampp server,but some of my friends using Wampp and MysqlServer. However I want to run my sql commands by running a .bat file.So I want to navigate to the MySql> prompt first.
I tried following CMD command to find the service,
tasklist /svc >mysqld.exe
but I can't navigate to mysql>
Help me if someone has any solution. Thanks.
tasklist /svc /fi "imagename eq mysqld.exe"you get Mysql service name and after display the details ofsc qc MYSQL57and to get particular details usefor /f "tokens=1*delims==" %a in ('wmic service where "name='MYSQ L57'" get pathname /value') do @for /f "delims=" %c in ("%~b") do @echo "%~c"