WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Printer Controller

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

pGetPrtList and FileCopy

Keywords: 	 pGetPrtList

Question:

I want to filecopy a file to a printer other than my default printer. How can I do this?

Answer:

pGetPrtList(1), returns a tab-delimited list of available printers. The format of the list depends upon "request":
Request	Meaning
  0		Printer names

  1	Printer information, in the form:
	printer-name|port-name|driver-name|printer-share-UNC
	Note: "printer-share-UNC" is the same value that's returned
	by pGetDefPrtInf(4).

Here is some code that may be of help...

AddExtender("WWPRT34I.DLL")
filetocopy="C:\autoexec.bat"
printers = pGetPrtList(1)
info=AskItemList("Printers", printers, @tab, @sorted, @single)
SharePath=ItemExtract(4,info,"|")
FileCopy(filetocopy,sharepath,0)
message("Printed","%filetocopy% to %SharePath%")



Article ID:   W14437
Filename:   pGetPrtList and FileCopy.txt
File Created: 2001:03:01:15:38:46
Last Updated: 2001:03:01:15:38:46