Link to home
Start Free TrialLog in
Avatar of mredfelix
mredfelix

asked on

>bat into an Executable

Hi i am administrator and have written several. bat files to work with certain administrator  .exe tools, to make life simple. These programs need to be run in a specfic order. for example 1.bat->1.exe 2.bat-->2.exe!  So what i want to do is tie them all together and crete a single .exe file so when some one clicks on it does the tasks. I have no programming skills and was woundering if there is a tool that does this for me. also to add a nice icon to it ;-).  If not I guess it can be done in VB..if so i will need some direction on that.
Avatar of InteractiveMind
InteractiveMind
Flag of United Kingdom of Great Britain and Northern Ireland image

You can simply create another batch file.. then by creating a shortcut to this batch file, allows you to add a custom icon for it.
The batch file would look something like this:

@echo off
call 1.bat
call 1.exe
call 2.bat
call 2.exe

By using the "call" statements, the next program won't run, until the previous one finishes. However, if you need them to run nearly simultaneously, but just start a little bit after the other one, then you can use the 'start' command instead of 'call'. And you can get it to delay 1 second between each start, like so:

@echo off
start 1.bat
ping -n 1 localhost>nul
start 1.exe
ping -n 1 localhost>nul
start 2.bat
ping -n 1 localhost>nul
start 2.exe


Hope that helps.

Regards;
Avatar of mredfelix
mredfelix

ASKER

yes i know we could do that. but i want to put all the files in to one file and then when you ran it it would run all. So the .exe would be a kind of zip file  but is an .exe which would run all off them.
There's an old utility called bat2exe:
http://www.computerhope.com/dutil.htm
> There's an old utility called bat2exe
Problem with that utility, is that it only translates Batch Script into one language, then compiles it (or something with the same result); it doesn't package multiple files into one...

We need some sort of Linker application, I suppose... :o\
yes i just need to link the files and the result being one .exe

i guess i will have to program it? can this be done in VB.where do i start.........

ps do not post a vb tutorial because i can find that off my own back will just need the the walkthrough to linking files
No idea, in VB; however, with Java, you can use JAR (Java Archive), which allows you to very easily group multiple files into a single file, and execute them with a double-click. However, if this feature did not exist, then what I would do, would probably code it to store the 4 files you want into a multidimensional byte array. Then during execution, you can merely write these byte arrays to 4 individual files, then pass them to the Runtime.

Just an idea..?
ASKER CERTIFIED SOLUTION
Avatar of Haggard1
Haggard1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
no i think the program will have to be written in a program language..is it easy in java

i have a.bat which runs and then b.bat which runs with b.exe then c.bat which runs with c.exe and then d.exe runs which has a few dll filles.

so package these   using jar array is that the best?
Oh! is b.bat a compiled exe or are b and c.bat calling b and c.exe?