Creating and Using Autoexec.zpl files

Article ID: 14431588

Issue / Question

Creating an Autoexec.zpl file

Applicable To

Zebra Printers that support ZPL Programming Language
Excludes: 2824 Series, 2844 Series, S4M (E53 Firmware Version), 888 DD/TT Series, MZ Series, ZQ110, EM220, EM220II

Resolution / Answer

In some instances it may become necessary or advantageous to create an AUTOEXEC.ZPL file.
It functions in much the same way as the autoexec.bat file in MS-DOS.

It can be used for setting up various parameters at the time the printer is powered up.
When the printer is powered on, it checks its non-volatile memory locations for the stored format called AUTOEXEC.ZPL.
If found, the contents of the file are automatically executed as a stored format.


The AUTOEXEC.ZPL file would be stored in one of the following *non-volatile memory locations of the printer.

  • A: compact flash memory (not used in current printer)

  • B: PCMCIA memory ( last used in Xi3+ printers)

  • E: Flash memory (current in all later model printers)

The following are examples of common AUTOEXEC.ZPL files that are used:

Note: An AUTOEXEC.ZPL file cannot be used to set the Command Character (i.e ^CCx command) and only one AUTOEXEC.ZPL file can reside on the printer.

Note: the E: memory references below can be substituted with A:, or B: memory
To understand ZPL you can refer to the ZPL manual

Set the Print width (^PW)
 

^XA
^DFE:AUTOEXEC.ZPL^FS
^PW406
^XZ


Set the Left position (^LS Label Shift)
 

^XA
^DFE:AUTOEXEC.ZPL^FS
^LS050
^XZ


Font Identifier (^CW)
 

^XA
^DFE:AUTOEXEC.ZPL^FS
^CWX,E:ARIAL.FNT^FS
^XZ


Print Rate (^PR)
 

^XA
^DFE:AUTOEXEC.ZPL^FS
^PR4
^XZ


Printing a quantity of a canned format at power up: (100 labels will automatically print after powering up the printer.)
 

^XA
^DFE:AUTOEXEC.ZPL^FS
^FO20,20^A0N,30,25^FDProperty of Acme Rental^FS
^FO20,60^A0N,30,25^FD847 Main Street^FS
^FO20,100^A0N,30,25^FDJupiter, FL 05002^FS
^PQ100
^XZ

 
Combination of all the above to a AUTOEXEC.ZPL files:
 

^XA
^DFE:AUTOEXEC.ZPL^FS
^PW406
^LS050
^PR4
^CWX,E:ARIAL.FNT^FS
^FO20,20^AXN,30,25^FDProperty of Acme Rental^FS
^FO20,60^AXN,30,25^FD847 Main Street^FS
^FO20,100^AXN,30,25^FDJupiter, FL 05002^FS
^PQ100
^XZ


To Delete an AUTOEXEC.ZPL file:
 

~JA
^XA
^IDE:AUTOEXEC.ZPL^FS
^XZ



After the printer is powered up and finishes the POST it goes into the AUTOEXEC.ZPL routine which might block a command to delete the AUTOEXEC.ZPL file.
The ~JA is used in the delete file sent to printer to break out of the AUTOEXEC.ZPL routine.

+ Product Codes

  • 105SLPlus Industrial Printers
  • 105SLPlus Industrial Printers
  • 110PAX Print Engines (disc.)
  • 110Xi4 Industrial Printer
  • 140Xi4 Industrial Printer
  • 170Xi4 Industrial Printer
  • 220Xi4 Industrial Printer
  • 2824 Plus Series
  • 2824-Z Series
  • All Surface RFID Label Solution
  • Desktop Printers
  • G-Series GC Desktop Printers
  • G-Series GK Desktop Printers
  • G-Series GX Desktop Printers
  • GC420d Desktop Printer
  • GC420t Desktop Printer
  • GK420 Healthcare Desktop Printers
  • GK420d Desktop Printer
  • GK420d Healthcare Desktop Printer
  • GK420t Desktop Printer
  • GK420t Healthcare Desktop Printer
  • GT800 Desktop Printer
  • GX420Rx Desktop Printer
  • GX420d Desktop Printer
  • GX420t Desktop Printer
  • GX430d Desktop Printer
  • GX430t Desktop Printer
  • HC100 Wristband Printer
  • HC100 Wristband Printer
  • Industrial Printers
  • LP 2824 Plus Desktop Printer
  • P4T Mobile Printers
  • P4T Mobile Printers
  • Print Engines
  • QL Series Mobile Printers
  • QL320 Mobile Printer
  • QL420 Mobile Printer
  • QLn Series Healthcare Mobile Printers
  • QLn Series Mobile Printers
  • QLn220 Healthcare
  • QLn220 Mobile Printer
  • QLn320 Healthcare
  • QLn320 Mobile Printer
  • QLn420 Mobile Printer
  • R110Xi4 RFID Printer
  • RFID Printers
  • RP4T RFID Printers
  • RP4T RFID Printers
  • RW 220 Mobile Printer
  • RW 420 Mobile Printer
  • RW 420 Print Station
  • RW Series Mobile Printers
  • TLP 2824Plus Desktop Printer
  • Xi Series Industrial Printers
  • ZD410 Series
  • ZD410D
  • ZD420 Series
  • ZD420-HC
  • ZD420C
  • ZD500 Desktop Printer
  • ZD500 Desktop Printer
  • ZD500R RFID Printers
  • ZD500R RFID Printers
  • ZE500 Print Engines
  • ZE500 Print Engines
  • ZE500R RFID Print Engine
  • ZE500R RFID Print Engine
  • ZM400
  • ZM600
  • ZQ500 Series Mobile Printers
  • ZQ510 Mobile Printer
  • ZQ520 Mobile Printer
  • ZR300 Series Mobile Printers
  • ZR338 Mobile Printers
  • ZR600 Series Healthcare Mobile Printers
  • ZR600 Series Mobile Printers
  • ZT200 Series Industrial Printers
  • ZT210 Industrial Printer
  • ZT220 Industrial Printer
  • ZT230 Industrial Printer
  • ZT400 Series Industrial Printers
  • ZT400 Series RFID Printers
  • ZT410 Industrial Printer
  • ZT410 RFID Industrial Printer
  • ZT420 Industrial Printer
  • ZT420 RFID Industrial Printer
  • iMZ Series Mobile Printers
  • iMZ220 Mobile Printer
  • iMZ320 Mobile Printer