This batch script starts the MSSQLLocalDB instance (if not already running), retrieves its named pipe connection string, updates the Windows Registry to point HeidiSQL to it, and finally launches HeidiSQL.
@echo off
REM Start LocalDB instance (if not already running)
sqllocaldb start MSSQLLocalDB
REM Get the named pipe connection string