How to print Landscape, Courier New, 10pt in NT Batch

Posted on 2009-02-12
Last Modified: 2012-06-27
I'm looking for a way to print a text file via NT (win2k) batch script with the following format: Landscape, Courier New, 10pt, with 0.5 inch margins on left/right

I've seen a similar positing, but it was for an Image file.  I dont know how to modify it to fit my requirements.  Printers are HP9000 series, accepts PCL and Postscript.
Question by:JayAZ
    LVL 28

    Accepted Solution

    Use the suggestion from the other post, but send the proper printer codes FIRST.

    To do this, you can try a free tool like HPSET ( with the command:
        HPSET LAND
    This sends the needed codes for a Landscape, 16.67 CPI fixed-width font, typically used for 132-column wide reports.

    The text string that this sends is the following:
    Where \033 is the Esc character (Decimal 27).

    If you want a specific font, and to set all of the other things like margins to an exact value, then you'd need to expand the printer codes to include those pieces of information, too.

    Author Comment

    I've tried to grasp printer codes, but to no avail.

    I'd like to build off the example in the link from a previous submission/question.

    In the following code (saved as PrintImg.vbs), it takes filename as the argument when called by cscript
    ie:  cscript PrintImg.vbs <filename>

    How can I modify it to set the font, font size, and margins?
    courier 10pt, 1 inch margins all around

    This little VB script uses OLE the create an instance of Word, creates a new document, imports the specified Image, sets the page orientation to landscape and sends the whole crap to the standard printer. After all it closes the document and destroys the ole object.
      Set Args=WScript.Arguments
      Set Word = WScript.CreateObject("Word.Application")
      Word.Visible = true
      Set Doc = Word.ActiveDocument
      Doc.InlineShapes.AddPicture FileName, True, False
      Doc.PageSetup.Orientation = wdOrientLandscape
      Word.ActiveDocument.Close False

    Open in new window


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
    How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    26 Experts available now in Live!

    Get 1:1 Help Now