Sign in to follow this  
Followers 0
BertInfo

Command Line Printer ?

5 posts in this topic

Hello everybody !!

I'm just looking for some command line printer on Autoit !!

I've find some of them like : DriverName, PortName, DeviceId, Location, Network, Shared, ShareName, ...

But i haven't found the complete list ...

Does anyone could give it to me please ... :)

Or else, my main goal is to custum my printer at start-up, for example : paper size, landscape orientation, ... but without the command line it's impossible ...

Thanks a lot and have a nice day

Bert

Share this post


Link to post
Share on other sites



Hello everybody !!

I'm just looking for some command line printer on Autoit !!

I've find some of them like : DriverName, PortName, DeviceId, Location, Network, Shared, ShareName, ...

But i haven't found the complete list ...

Does anyone could give it to me please ... :)

Or else, my main goal is to custum my printer at start-up, for example : paper size, landscape orientation, ... but without the command line it's impossible ...

Thanks a lot and have a nice day

Bert

Several scripters, (Including me) have designed printer tools. Do a search, and you can find what you need. If you need info on how to install printers via command line, Google is your friend.

http://www.google.com/search?hl=en&q=p...amp;safe=active

Share this post


Link to post
Share on other sites

Thanks a lot ... of course google is my friend and U now :) and more after this add (i hope so !!!)

But in fact, to be more explicit : i don't need to install a printer ... i've got a text file with informations, i call the function "_FilePrint()". But the printing configuration had to be customized, for example : changing printing orientation to landscape, paper size ... and from what i've ever search (on google!! and other :D) all functions i've found are listed below :

$DriverName = $objFromPrinter.DriverName

$PortName = $objFromPrinter.PortName

$DeviceId = $objFromPrinter.DeviceId

$Location = $objFromPrinter.Location

$Network = $objFromPrinter.Network

$Shared = $objFromPrinter.Shared

$ShareName = $objFromPrinter.ShareName

$Availability = $objFromPrinter.Availability

$ShareName = $objFromPrinter.Description

$ShareName = $objFromPrinter.PrinterState

$ShareName = $objFromPrinter.PrinterStatus

$ShareName = $objFromPrinter.PrintJobDataType

$ShareName = $objFromPrinter.PrintProcessor

$ShareName = $objFromPrinter.SpoolEnabled

$ShareName = $objFromPrinter.SeparatorFile

$ShareName = $objFromPrinter.Queued

$ShareName = $objFromPrinter.Status

$ShareName = $objFromPrinter.StatusInfo

$ShareName = $objFromPrinter.Published

$ShareName = $objFromPrinter.Direct

$ShareName = $objFromPrinter.Location

$ShareName = $objFromPrinter.Priority

$ShareName = $objFromPrinter.WorkOffline

$ShareName = $objFromPrinter.HorizontalResolution

$ShareName = $objFromPrinter.VerticalResolution

So i'm trying ... "PaperSize" or "PaperOrientation" but it doesn't work ... and i repeat : i've search on Google and AUTOit forums but without success ... i hope you understand my words ... english have never been my favorite work at school :D

Bert

Share this post


Link to post
Share on other sites

Ok, from what you are saying, let me see if I understand what you are attempting.

You have a text file that has captured the info on a printer that is already installed.

You need to change the settings.

Am I right on this?

If I'm right, a MUCH better way of manageing your printer setups is to have a Windows Server (Or a PC will do in a pinch) that can be used as a print server. There is some work you would need to do on the front end, and it will take a while depending on how many printers and PCs you have in your enviroment. The important thing to remember is once you have done this, your work will be MUCH easier to manage, and to control. The payoff is on the backend of this little endevor, not the front.

1. Install the printer on the server or PC you want to have as a print server. Use TCP/P to connect to the printer.

2. Create a share of this printer on the server.

3. When naming the share, use a naming standard that will allow you to easily locate the printer in case you need to get to it.

example:

03_4000_15.131.15_PCL

03 = the floor

4000 = the model, in this case a LaserJet 4000

15.131.15 = Part of the IP you need. If everything in your enviroment begins with say "14", you can drop this off the name to make it shorter.

PCL= the driver being used. You could use PCL5, BW for black and white if you have a color printer set to print black and white, and use PCL_Color to denote a color printer.

4. For each PC, have then access the print server and douple click on the printer they want to have installed. THis will push the driver down to the PC, and the settings you want. THis will only connect the printer on a profile level, so if anyone else logs in, the printer won't be mapped. If you want to install the printer on a machine level, you will need to use the printer install utility Danny35d made. It can be found here.

Now here is the fun part. If you need to change the driver configuration, or change drivers, simply make the change on the print server. The changes will be pushed down to the users, so you don't need to do anything to the workstations. Also, if the user needs to be connected to a new printer, send them a link, and have them simply open it. No fuss, no muss.

Now if you simply need to change the settings on a printer driver that is on a user's PC, the command line stuff I sent you will do it. Basically, you would push the new driver with the settings you want, and that would overwrite what is on the PC. Take a look here for more info on how to use it.

Share this post


Link to post
Share on other sites

It works !!!

To help someone ... here is the way i do :

- Download a "VB Script Editor" : it helps me to have the complete list (see my first topic) and read paper size and orientation BUT on read only so ... see below ...

- On Auto-it i customized my printer using the registry :

; Paper size

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\DYMO LabelWriter 310\DsDriver", "printMediaReady", "REG_MULTI_SZ", "99012 Large Address")

; Paper size

RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Printers\DYMO LabelWriter 310\PrinterDriverData", "TrayFormTable", "REG_MULTI_SZ", "Default" & @LF & "99012 Large Address" & @LF & "0")

; Paper Orientation : Landscape forced

RegWrite("HKEY_CURRENT_USER\Printers\DevModePerUser", "DYMO LabelWriter 310", "REG_BINARY", "440059004d004f0020004c006100620065006c005700720069007400650072002000330031003000000000000000000

00000000000000000000000000000000001040005dc00340243ef8107020083006b077c01640001000f002c01010001002c0

10200010039003900300031003800200053006d0061006c006c0020004c00650076006500720020004100720063006800000

0000000000000000000000000000000000000000000000000000000000000000001000000000000000100000002000000010

10000ffffffff0000000000000000000000000000000044494e55220000003402000007ed3e8000000000000000000000000

0000000000000000000000000000000000a00000000000000010000000c00000000000000020001000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000")

That's all ... thanks again Volly, see U

Bert

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0