0

I want to merge BAT file with my exe file, so I can execute with single click batch commands and programs , maybe converting BAT to COM extension will help in binding them ? Also do batch even work for that EXE ? Can they be executed in order maybe to work.

Thank you.

4
  • Take some time to actually explain what you're trying to do. If you want to launch just two programs ... use a batch?
    – Seth
    Sep 27, 2017 at 11:55
  • The words "merge" and "bind/ing" don't make sense in this context. Can you clarify what you mean? Sep 27, 2017 at 11:55
  • Sorry for unclear question. I want to bind batch windows script with exe file and have single exe which will perform batch file commands for binded exe file
    – Thomas
    Sep 27, 2017 at 12:19
  • Please just explain what is supposed to happen and what is happening now. Without hinting at any supposed solution. Update your question with that description.
    – Daniel B
    Sep 27, 2017 at 12:54

2 Answers 2

2

A batch file is a set of instructions.

You can make the batch file run the executable, and so you have one file to click.

If you want to get rid of the fact that you have multiple files stored at a single location, consider moving the files to a folder, for example C:\MyTools, and create a shortcut to that .cmd file in another folder, for example your desktop.

Now you can execute your batch file without seeing all the other files.

If you ask this because you want to distribute your files as a single file, then you will be required to work with .exe files.

A batch file cannot contain anything else but text.

It is possible to create a Self-Extracting Archive that once you run it, extracts its content to a temporary location, then run your command script.

You can distribute this one file and it will work. The down side is that you will have to do the cleanup manually too from inside your bat file if you want people to only use that one file without leaving the programs behind in their temp folder, which they can find if they browse there.

Winrar can make self-extracting archives that run a batch file immediately after. I use that if I want to create an executable that extracts itself and runs a second executable that is inside with certain parameters, for example a portable Chrome browser that starts a website.

0

You cannot do this. BAT, COM, and EXE files are not made or run in the same way, and therefore cannot be combined into a single file.

Not the answer you're looking for? Browse other questions tagged or ask your own question.