Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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