@echo off echo 0 %0 taskkill /f /IM chrome.exe echo after kill chrome echo current folder is %cd% for %%F in (%0) do set dirname=%%~dpF echo dirname: %dirname% IF EXIST "C:\Program Files\Google\Chrome\Application\chrome.exe" ( echo Chrome 64bit with CORS command line override switch "C:\Program Files\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files --app=%dirname%\html5_index.html --window-size=1400,1000 REM restart chrome to allow user to re-open closed tabs REM "C:\Program Files\Google\Chrome\Application\chrome.exe" ) ELSE ( IF EXIST "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ( echo Chrome 32bit with CORS command line override switch "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files --app=%dirname%\html5_index.html --window-size=1400,1000 REM REM restart chrome to allow user to re-open closed tabs REM"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" ) ELSE ( echo default to Microsoft Edge echo Running with Microsoft Edge start "" "msedge.exe" --allow-file-access-from-files --app=%dirname%\html5_index.html --window-size=1400,1000 ) ) pause