CMD2EXE v 1.01 Documentation.

Greetings!

Thank you for trying out CMD2EXE, a batch-file-to-EXE tool for Windows XP and Windows 2000. Please send me your feedback on the program via e-mail (jimbo@radiks.net ).

CMD2EXE is shareware. It is not free software. If you use it after a trial period of 30 days, you must register it ( pay for its use. )

Please visit my software support web site for updates to CMD2EXE and general information on enhancements. http://www.mailsend-online.com


Disclaimer

Jim Lawless is not responsible nor liable for any damage incurred by use of the CMD2EXE system. You must try CMD2EXE in a safe environment prior to registering the software. Registration indicates that you understand CMD2EXE to be safely functional in your intended environment. Use this software at your own risk.

Index


What is CMD2EXE?

CMD2EXE is a command-line utility that will embed a batch file and other optional files into an EXE file. It does not "compile" the batch file ... it simply bundles it into the EXE.

When the generated EXE is executed, the batch file and all other supporting files are written to a temporary directory and is then executed.

After termination of the batch process, all files in the temporary directory are removed as is the directory itself.


How can I use CMD2EXE?

CMD2EXE can be used to deploy groups of batch files, batch files and supplementary data files, or just a single batch file. Generally, users cannot tamper with batch files once they've been embedded in an EXE with CMD2EXE.

CMD2EXE can be used to simply hide details from the user, deploy batch files with their utility EXE's such as command-line mailers or registry manipulation tools, or as simple setup tools.


Installing CMD2EXE

To install CMD2EXE, you'll need an "unzip" utility such as WinZip or PKZIP. Unzip CMD2EXE into a directory. You can then run it from that directory. There is no formal installation process.

To uninstall CMD2EXE, simply delete those same files from the directory you created. CMD2EXE does not leave residual registry entries.


A Sample Session with CMD2EXE

In the CMD2EXE archive, you'll find a sample batch file named samp.bat. It contains the following:
      @echo off
      : CMD2EXE sample
      Echo Hello from a CMD2EXE-packaged program!
      Echo The batch file was placed in %c2e_bdir%.
      dir %c2e_bdir%
      Echo The EXE file is in %c2e_edir%.
      pause
      call %c2e_bdir%\samp2.bat

The file samp2.bat is also included in the archive and contains the following:

      Echo In sample batch file 2!
      pause

Let's go ahead and try to generate an EXE containing these two batch files. From a command-prompt in the directory where CMD2EXE was installed, type the following:

      cmd2exe -i samp.bat -o tester.exe -f samp2.bat

You should see output similar to the following:

      CMD2EXE version 1.01 ( Trial Version )
      By Jim Lawless  -- jimbo@radiks.net

      Output file is : tester.exe
      Primary batch file is samp.bat
      There are 1 additional sets of files:
      1     samp2.bat
      Adding samp.bat
      Adding samp2.bat

At this point, the new file TESTER.EXE contains both batch files. Let's try to run it. From the command-prompt, type:

      tester.exe

You should see output similar to the following:

      C:\proj\cmd2exe>tester
      Hello from a CMD2EXE-packaged program!
      The batch file was placed in C:\DOCUME~1\user\LOCALS~1\Temp\c2e3.
       Volume in drive C has no label.
       Volume Serial Number is xxxx-xxxx

       Directory of C:\DOCUME~1\user\LOCALS~1\Temp\c2e3

      06/20/2004  06:12 PM    <DIR>          .
      06/20/2004  06:12 PM    <DIR>          ..
      06/20/2004  06:12 PM               199 samp.bat
      06/20/2004  06:12 PM                37 samp2.bat
                     2 File(s)            236 bytes
                     2 Dir(s)  51,473,854,464 bytes free
      The EXE file is in C:\proj\cmd2exe.
      Press any key to continue . . .

Every EXE generated by CMD2EXE causes two environment variables to be available to the running batch file: c2e_bdir and c2e_edir.

c2e_bdir is the full path to the directory where the batch file and supplementary files have been placed. Note that this environment variable is used to ensure that we can call samp2.bat correctly. ( See the minor changes section for more information on why this is necessary. )

c2e_ediris the full path to the EXE file which contains the embedded batch file and supplements.

You'll note that both batch files have been placed in this temporary directory.

samp.bat then calls samp2.bat ... yielding the output:

      In sample batch file 2!
      Press any key to continue . . .
After execution of the batch file, the EXE generated by CMD2EXE then removes all files in the temporary directory, by executing the following commands:
      @for %x in (dirname\*.*) do @del %x
      @rd dirname

This will remove any files from the work directory including any that have been generated by your batch files.


Minor changes you may have to make in your batch files

Understand that while the batch files embedded in your generated EXE are running from a temporary directory, they are operating under the context of the directory containg the EXE itself.

We leveraged the power of one of the environment variables c2e_bdir, in samp.bat so that we could appropriately call samp2.bat in the batch directory:

      call %c2e_bdir%\samp2.bat

Restrictions in Using / Copying CMD2EXE

You may place the trial CMD2EXE archive ( CMD2EXE.ZIP) on any website or on any shareware CD collection. You may also place CMD2EXE on CD's packaged with magazines or books.

The programs you construct with the registered version CMD2EXE can be freely distributed on an unlimited basis with no further royalties or other payments due to me. You may test EXE's generated with CMD2EXE with users in your internal corporation or client site, but you may not use the trial version to generate general-purpose EXE's.

You may not distribute CMD2EXE as part of another system or software package.


Registering ( paying for use of ) CMD2EXE and terms of use

The trial edition of CMD2EXE has no time-limit. The limiting factor in the trial version is that the generated EXE's will only run on the day they are compiled.

If you use CMD2EXE beyond 30 days, you must either register CMD2EXE or cease using the product.

You must register one copy of CMD2EXE for every person using the software. If you have 5 support technicians, each of whom could execute CMD2EXE to compile batch files, they must each have their own copy. Concurrent licenses are NOT supported. You may register by visiting the CMD2EXE section of my web site. Click the "Buy now!" link in this section:

http://www.mailsend-online.com

Registration price

The registration fee for CMD2EXE is $20 per copy in U.S. funds. VAT tax is automatically added by my registration processor if applicable.

Please contact me if you're interested in purchasing bulk licenses for CMD2EXE.

Delivery

You will NOT receive a registration code for CMD2EXE. Rather, you will receive a URL in your e-mail indicating how to download the registered version. You may not share this URL with anyone.

Revision history

(06/21/2004) 1.02 Added command-line parameter support to generated EXE's.

(06/20/2004) 1.01 Initial public release.