简体   繁体   中英

Creating an executable file from set of exe and bat files

I have two .exe file and 3 windows batch files and i need to run these 5 files one by one.

But i don't want to do that manually, all that i need is to create an parent executable file(using java or any other utility) that consists of all the required 5 files and executes them in an required order.

I don't want to create another parent batch file to execute all the files because, including this new batch file we need all the other files as dependents to execute the parent batch file.

So, is there any way to create an executable file which contains all the required 5 files so that i can execute that parent executable file?

A nice library for this is Apache Commons Exec . You can include the binaries as resources which you later pull out with getResourceAsStream() . You may have to write the files somewhere first before executing which you can do with Apache Commons IO ( FileUtils.copyInputStreamToFile() ).

An easy way might be to use an installer such as winzip self-extracting executable ( http://www.winzip.com/prodpagese.htm ) to do the job. ie write a batch file that executes the 5 files in the desired order and set it as the target to run when the extractor completes. the end result is you have one exe that runs all 5 batch files in order.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM