• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 597
  • Last Modified:

>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.
0
mredfelix
Asked:
mredfelix
  • 3
  • 3
  • 2
  • +1
1 Solution
 
InteractiveMindCommented:
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;
0
 
mredfelixAuthor Commented:
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.
0
 
cookreCommented:
There's an old utility called bat2exe:
http://www.computerhope.com/dutil.htm
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
InteractiveMindCommented:
> 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\
0
 
mredfelixAuthor Commented:
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
0
 
InteractiveMindCommented:
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..?
0
 
Haggard1Commented:
I've used Bat.exe and unfortunatley I've never heard of a app that will do that for you.  Your best bet is to manually combine the batch files into one using Goto and Labels. Assuming the batch files flow from top to bottom not to much jumping around you just tack on to the end of the first batch file. Just make sure their are no duplicate labels i.e.

@ECHO OFF

IF Exist %WINDIR%\NOTEPAD.EXE GOTO STRNTPAD
GOTO EXIT

:STRNTPAD
REM STARTING NOTEPAD
CALL %WINDIR%\NOTEPAD.EXE

:EXIT

Just make sure if you change a label that it is not refernce anywhere else if so you need to change that reference also ; )

Hope this helps even though it wasn't what you wanted.

Cheers




0
 
mredfelixAuthor Commented:
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?
0
 
Haggard1Commented:
Oh! is b.bat a compiled exe or are b and c.bat calling b and c.exe?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now