WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

DOS

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Embed a DOS Batch File in a
Compiled WinBatch EXE

Keywords:  compiler   

Question:

I want to include my DOS batch file, which I run from WinBatch, in my compiled EXE. Can I do this?

Answer:

Yes. In Winbatch 98/99, you can simply compile the DOS batch file (or any other auxilliary files) into the EXE by first copying the desired files into the \WINBATCH\SYSTEM\ subdirectory. Then start up Compiler, and click on the "Other Files" button. You'll be presented with a list of all the files in the \SYSTEM\ subdirectory. Select your file(s), click on "Add Highlighted file above to list on right", then click on "Done". Now when you compile your EXE, these files will be included. At runtime, they will be written out into the directory where the compiled EXE resides.

In versions of Winbatch prior to 98, here's what you need to do:

  1. Put a copy of your DOS batch file in the \WinBatch\System subdirectory. (This is for the 95+ versions of WinBatch).

  2. Start up Notepad to edit a new file.

  3. On the first line of the file, add a title that you want displayed in the Compiler dialog box, and then on a second line, add the name of your DOS batch file, something like:
            Include MyBatchFile
            NAMEOFBAT.BAT
    
    Don't put the path to the DOS Batch file in the second line. You could also put a list of batch files, separated by commas, if you want to include a bunch of files.

  4. Save the file with the file extension *.DAT in the \WinBatch\System subdirectory. You can look at other files with the *.DAT extension in that directory to see how we set them up for you.

  5. Now launch the Compiler, and choose the Large Standalone option.

  6. Hit the Extenders button, and you should now see your new line, "Include MyBatchFile", displayed in the dialog box. Select it, and hit OK, and you're done.
When this runs, your batch file(s) will automatically be created in the same directory as your compiled EXE, assuming you're not running off a floppy disk.
Article ID:   W12891
Filename:   How to Embed a DOS Batch File in Compiled EXE.txt
File Created: 1999:04:15:16:50:20
Last Updated: 1999:04:15:16:50:20