my.bat is not recognized as an internal or external command, operable program or batch file

4.2k Views Asked by At

I created a .bat file that opens up a specific webpage I use for work in app mode on Chrome (so it removes the tabs and address bar to save space). I wanted to convert this .bat file to .exe (for a number of reasons that may seem pedantic). I used iexpress to convert the .bat to .exe. When I try to run the .exe the DOS window very briefly flashes and then crashes. I was able to grab a screenshot of the message as it was closing. The message is in the Title.

The script in my .bat is as follows:

@echo off
set "SystemPath=%windir%\System32"
if not "%ProgramFiles(x86)%"=="" set "SystemPath=%windir%\Sysnative"
start Chrome.exe --app=http:XXXXXXXXX 

I added cmd /c to the "install program to launch" because I'm on Win 7. I opened the file in Notepad++ and it's encoded without BOM. I haven't been able to find another reason why my .bat file isn't being recognized.

0

There are 0 best solutions below