Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use to make a .bat->.exe to run a .exe within same terminal/prompt window #10

Open
vertigo220 opened this issue Jun 20, 2022 · 1 comment

Comments

@vertigo220
Copy link

I'll use C:\Program Files\7-Zip\7z.exe as an example.

I'm trying to convert a batch file that runs an exe file into an exe file so I can add a single folder to %path% and load it with these files which call their corresponding files in their locations, to prevent having to add each of those locations to %path% due to the size limitations. I can't just use a batch file, since 7z.bat which runs 7z.exe above won't come up in path when I try to do 7z.exe ... (in theory 7z ... would work, but I'd rather not do it that way and use the same/.exe extension to avoid possible issues if something tries running 7z.exe, which would be the norm, vs just 7z).

The problem is, I can run 7z.exe from the prompt and it will run in the same prompt, I can run 7z.bat and have it run 7z.exe and it runs in the same prompt, but if I create 7z.bat->7z.exe and run it, it runs in a new prompt/window, which is undesirable behavior. It should be possible to have it run in the same prompt, but it would take a change to bat2exe, perhaps through an additional switch that would modify the behavior. I'm just guessing, but it seems bat2exe is creating a basic exe without a CLI, so that launches and then launches the batch script, which then happens in a new window, whereas it needs to create an exe than runs as a CLI. Basically, the difference between 7zFM.exe and 7z.exe.

@vertigo220
Copy link
Author

After trying a couple other options, I finally found one that does what I need: Advanced BAT to EXE Converter. I'd still much prefer to use bat2exe due to it being portable and enabling me to create the exe's on the fly via a batch script, but I wanted to point that out both in case anyone else was looking to do this and to show that it is in fact possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant