SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Change printer using VBScript

    I have a simple script that takes a txt file and prints it using notepad. The problem is that it prints to the default printer which I do not want. I'd like it to print to a second installed printer without changing the default.

    This is all I do to print:
    Code:
       
    oWS.Run "NotePad.exe /p " + path
    Unrelated to that, the default printer is a receipt printer, only about 24 chars wide. The page that script is trying to print is set for 84 chars but most of that is spaces. The receipt printer prints very slowly, like print line, pause, print line, pause, etc. Any ideas?

  2. #2
    Just Blow It bronze trophy
    DaveMaxwell's Avatar
    Join Date
    Nov 1999
    Location
    Mechanicsburg, PA
    Posts
    7,265
    Mentioned
    115 Post(s)
    Tagged
    1 Thread(s)
    From what I've dug up via google (haven't tested it, but it's worth a try...)

    notepad.exe /pt %1 %2 where %1 is the filename and %2 is the printer name.

    As for your second question, can you clear out the extra spaces? On some of the older style printers (note I said older style, not older), the spaces will still be "printed" so that will cause time to handle the effort.
    Dave Maxwell - Manage Your Site Team Leader
    My favorite YouTube Video! | Star Wars, Dr Suess Style
    Learn how to be ready for The Forums' Move to Discourse

  3. #3
    SitePoint Wizard drhowarddrfine's Avatar
    Join Date
    Aug 2005
    Posts
    3,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Aha! Good. I googled for notepad options and found that. Thank you. I'll change that later and try it out. (I know nothing of VBScript and the script I'm using was written by some Windows guy.)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •