1

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.

riQQ
  • 9,878
  • 7
  • 49
  • 66
jswisher
  • 11
  • 1
  • 2
  • Put a PAUSE at the end of your bat file so you can see the error message. – RGuggisberg Aug 13 '15 at 18:26
  • What appears when the `@echo off` line is removed? – lit Aug 13 '15 at 19:05
  • RGuggisbert- I tried putting a pause command at the end of the script but it still auto-closes. The message says that the file isn't a valid .bat so I don't think it's accepting anything I put in the script. Paul- I've tried with just the Start command by itself (the .bat runs, but I get the same error.) – jswisher Aug 13 '15 at 19:55
  • 1
    Can you post your SED and EXE file? Also are you running on Windows 7 32-bit? I believe iexpress only uses command.com (16-bit) to execute the post installation command, ignoring the cmd.exe. – David Ruhmann Aug 13 '15 at 19:58
  • 1
    Check to see where my.bat is being referenced. Make sure my.bat is being properly referenced. That error is often thrown when the path to the .bat or .exe file is incorrect. – Brad Aug 14 '15 at 17:10
  • Does the .exe run correctly on a non-work computer? As noted in [this comment](https://superuser.com/questions/868340/how-can-i-convert-a-windows-batch-script-to-a-exe#comment1891327_868341), and by my own personal experience, corporate AV software often flags these kinds of things as "bad", and "is not recognized as an internal or external command" is exactly the kind of message you will get. – JonathanDavidArndt Jan 16 '20 at 12:58
  • `my.bat is not recognized as an internal or external command, operable program or batch file` has nothing to do with the contents of that file. The errormessage simply translates into "I cannot find the file (where I expect it to be)" (it's expected either in the current working folder or within the PATH). Show us, how you try to execute it. – Stephan Jan 16 '20 at 17:10

0 Answers0