I'm working on a portable development enviroment, so I need to find the route of the bins.I have tried with this:
for /f "tokens=*" %%a in ('dir mysqld.exe /b /s') do set mysql=%%a It returns A:\test\mysql-5.7.24-winx64\bin\mysqld.exe but I want to get only the folder, like this A:\test\mysql-5.7.24-winx64\bin\, how can I achieve this?.
For /F "Delims=" %%A In ('Dir /B/S/A-D-L "%~d0\mysqld.exe" 2^>Nul')Do Set "mysqldir=%%~dpA"orFor /R %~d0\ %%A In (mysqld.exe)Do Set "mysqldir=%%~dpA"