bat2exe
bat2exe copied to clipboard
Error when running the .exe file created by bat2exe
when I try to run any .exe file created by bat2exe, it gives me this error: 'C:\Users(my username)\AppData\Local\Temp\7zSC0DA0427\error.bat' is not recognized as an internal or external command, operable program or batch file.
- error.bat is the name of the file I'm trying to convert. I wanted to make a custom error popup into an exe so I called it error.bat.
Does your username contain spaces or special characters?
no
Please provide the code for your batch file and steps to recreate the error. also consider running the exe on a different pc if possible
if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start "" /min "%~dpnx0" %* && exit @echo off cscript error.vbs exit
The cscript file is the actual error message and its code is as follows: x=msgbox("This application could not be opened",0+16,"Error")
I realize it's been a couple years, but a few issues I see right away:
- the space between the 1 and && is going to set IS_MINIMIZED to "1 " so you either need to do 'set IS_MINIMIZED=1&&' or 'set "IS_MINIMIZED=1" &&'
- You said you're using 'C:\Users(my username)...' which needs to be 'C:\Users(my username)...' (an even better way is to simply use "%userprofile%..."
- %~dp0 can sometimes be problematic. Is the directory in the error the actual location of error.bat?