Microsoft KB Archive/300518

= SAMPLE: Rename Printers via Windows Script Host =

Article ID: 300518

Article Last Modified on 8/9/2004

-

APPLIES TO


 * Microsoft Windows Scripting Host 2.5
 * Microsoft Windows Scripting Host 2.5

-



This article was previously published under Q300518



SUMMARY
Due to limitations in Windows Script Host, there is no method to rename printers once they have been created. For Windows 95/Windows 98 clients the problem is exacerbated because the AddWindowsPrinterConnection method uses the printer driver name for the printer name. This causes a problem if more than one printer that uses the same driver must be added. This article provides source code (Renprinter_source.exe) for a sample Win32 dynamic link library (DLL) called Renprinter.dll that implements the following Win32 APIs:

OpenPrinter

GetPrinter

SetPrinter

ClosePrinter

This DLL can be called from script, and a sample is included with the source.



MORE INFORMATION
The following file is available for download from the Microsoft Download Center:

Renprinter_source.exe

Release Date: JUN-05-2001

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. The Renprinter_source.exe file contains the following files:

Additional query words: kbAudDeveloper kbWSHSearch Renprinter_source

Keywords: kbhowto kbdownload kbfile kbdswmanage2003swept KB300518

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.