Resetting an HP LaserJet’s serial number – Send a PJL command over FTP in Windows 7

Users press buttons.

If something stops working as expected, they will probably press every button they can see before reaching out to IT for help.

While I’m all for self-service when it comes to IT issues, we had a recent problem where a user managed to perform an NVRAM reset* on one of our HP LaserJet printers! This wipes out the serial number, page counts etc. and replaces them with XXXXXXXXXX. Unfortunately the page counts seem lost for good but  to reset the serial number you need to send PJL commands directly to the printer.

This used to be done by connecting a PC to the printer via a parallel cable. You would then enter some DOS commands to copy a “PJL” file onto the printer for processing. You can also send the PJL file using the HP Firmware Update Utility/Tool but I can’t seem to find it available for download anywhere.

As I am writing this in 2013, I only have network printers and Windows 7 x64 to hand. After a lot of digging I managed to work out how to do it.

Sending PJL Commands via FTP command line

Pre-reqs – notepad++

  1. Paste the following into Notepad++, changing the serial number to what it should be (replace {esc} with ALT+027 keypress).
    • @PJL RESET
    • {esc}%-12345X
  2. Save this as a normal text file, no need to change encoding or do anything special
  3. Copy the file via FTP
    1. Open a command prompt
    2. Type ftp {printer-hostname} e.g
      • ftp custsrv2
      • ftp
    3. Leave username blank, hit enter
    4. Leave password blank, hit enter
    5. Type “send {filepath}” e.g.
      • send “C:\temp\custsrv2sn.txt”
    6. The command will be processed, only takes a couple of seconds
    7. Type “quit” to exit FTP
  4. Check out the configuration page of your printer and it should display the updated serial number

If anyone out there knows a command that will reset the page count on an HP LaserJet P4014 please let me know in the comments! I tried several of the documented ones but none of them worked 😦

Please note, if you are setting the model number make sure you surround it with quotes otherwise it won’t be accepted.

Further Reading

I used the following sources to help with my understanding of PJL, you might find them useful too

A note on the {ESC} character

The hardest part of this was discovering how to get the {ESC} character to appear!

I had read that you needed Notepad++ to see the ESC character. This is because it can read ANSI encoded files, whereas most Windows files are encoded in UTF-8 format, meaning they won’t show properly in Microsoft Notepad.

I managed to get an example ANSI file by simply creating a blank document in Word and printing it with the “Print to File” box checked. This actually creates a file with the *.prn extension which, you guessed it, is ANSI encoded.  This enabled me to copy and paste ESC into a new file to use at my disposal.

ESC Character in Notepad++ screenshot

However, I didn’t want to have to go through this palaver each time just to get a simple character! I discovered that the escape character had a Decimal value of 27 which means I can use the key combination of ALT+027 (using the NumPad keys) to make {ESC} appear in Notepad++. This also lead me to discover a feature of Notepad++ I wasn’t aware of, the Conversion Panel. You can find it under Plugins > Converter. This lets you put in a value in either ASCII, Decimal, Hexadecimal, Binary or Octadecimal and it will show you the related value in all the other formats

Notepad++'s Conversion Panel screenshot

*Intentionally resetting HP LaserJet’s NVRAM

NVRAM initialization is something you wouldn’t really want people to know but may be useful if you want to dispose of the printer or sell it on. Below is the documentation from HP’s printer manual

CAUTION: Initializing NVRAM resets the serial number, the event log, the page counts, the calibration settings, and the EIO card. Use the SERVICE menu to restore the serial number and page counts. You also need to reconfigure any computers that print to this product to recognize the product. Initialize NVRAM only when absolutely necessary. In most situations, use a cold reset to reset product variables but still retain the needed values in the SERVICE menu.

Before initializing NVRAM, print a configuration page and a supplies status page to gather the following information:

  • Total page count
  • Serial number

Reset Instructions

  1. Turn the product on and watch the control panel display.
  2. When the display shows the memory count, press and hold the down arrow until all three lights on the control panel are lit.
  3. Press the up arrow
  4. Press Menu . The message SKIP DISK LOAD displays on the control panel.
  5. Press the up arrow until NVRAM INIT is highlighted, and then press OK.
  6.  The printer then continues its power-on sequence.

7 thoughts on “Resetting an HP LaserJet’s serial number – Send a PJL command over FTP in Windows 7

  1. You mean to tell me that the guy who specifically requested this hasn’t even liked or thanked you? Lol unreal. I appreciate you at least 🙂 xx

      1. Give this a try



What do you think?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s