MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: Batch Files[Next]: Batch File Parameters
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Tips and Tricks->Batch Files->Batch File Tips and Tricks

Batch File Tips and Tricks

If you are after information on how to execute batch files during installation then have a look at the "ExeCa" command as this section describes some useful things to know.

You need to be very careful to confirm that the features you use exist in the operating systems you are supporting, a lot (but probably not all) of the following is likely to work in WINNT+ (WINNT, WIN2000, WINXP etc).

The most useful standard Windows commands are probably (use the "/?" switch on command to see its documentation):

  1. FOR
  2. SET
  3. FIND / FINDSTR.EXE
  4. START

Some tips on specific commands:

There are many interesting web sites where you can get more information (a good google should find them), there are quite a few good tips (and subroutines) at the "Batch Function Library for Windows NT4/2000/XP/2003This external link was OK when tested at 15 Nov 2008" site.

The following sections have specific tips:

  1. Batch File Parameters
  2. Convert Long FileNames to Short (8.3)
  3. Create File containing IP addresses from file with Workstation List
  4. Delayed Expansion (in loops)
  5. Get Day, Month, and Year
  6. Get File Safe Dates and Times
  7. Does a File Contain Some Text?
  8. For Loops
  9. Get Name/Directory of the Batch File
  10. Logging RollOver (keep "x" logs)
  11. Logging Whole Batch File Execution
  12. Maths
  13. Meaningful Return Code
  14. Read and Process a File line by line
  15. Read first line of a Text File
  16. Replace One String with Another
  17. SET Command - Text Manipulations
  18. Special Characters (tabs etc)
  19. Subroutines (common code)
  20. Sweep (Execute command(s) per File or Directory)

Batch Files - External Links

Some good external links:


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006 & 2007 for the Windows SDK (Windows Installer) area.This external link was OK when tested at 15 Nov 2008Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: Batch Files[Next]: Batch File Parameters


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday November 15 2008 at 2:05pm
Visit MAKEMSI's Home PageThis external link was OK when tested at 7 Nov 2008

HTML page dated Mon, 29 Jan 2007 00:11:11 GMT
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006 & 2007 for the Windows SDK (Windows Installer) area.This external link was OK when tested at 15 Nov 2008