>I installed the WSH. Before I run my code do set('printer',2) to store the default printer. I run my code then the WSH code:
>oWNet=CreateObject("WScript.Network")
>oWNet.SetDefaultPrinter(tv1np).
>The trouble is the name of my default printer is different in my printers window than what the set('printer',2) retreives. So I get an error. What WSH code could I use to retreive the default printer name?
The SetDefaultPrinter() method takes the remote printer name (defined as \\Server\Printer1 for example), not the printer name, which is what SET('PRINTER', 2) returns. APRINTERS() will load an array with this information. The first column being the printer name and the second the port. You could use this function to locate the printer and find the corresponding port. Note that, SET("PRINTER", 2) will return the name in all upper case, while APRINTERS() uses mixed.
George
Ubi caritas et amor, deus ibi est