Scripting School: How do I map printers?

Article

Scripting School: How do I map printers?

Christa Anderson, Contributor

Mapping printers uses methods other than the one for mapping drive locations, but the basic idea is very similar.

To map a network drive, you would use the MapNetworkDrive method to Wsh.Network and supply the drive letter and path to that drive as arguments. To map a printer, use that object's AddWindowsPrinterConnection method and supply the shared printer path as an argument.

Want to make that printer the default? No problem -- first add that printer connection, then use the SetDefaultPrinter method.

Scripting School: More on connecting to network resources

- Introduction

- What happens to all those mapped drives?

- What about location-based mappings?

-  How do I map printers?

- Does Select Case support wildcards?

- How to put the script together

- MapResources

    Requires Free Membership to View

    By submitting your registration information to SearchWindowsServer.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchWindowsServer.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

sample script

- Summary

 

Read Christa's previous columns:

ABOUT THE AUTHOR:
A Terminal Services MVP, Christa Anderson is the strategic technology manager for visionapp She formerly was program manager for the Microsoft Terminal Services team. She is an internationally known authority on scripting, the author of Windows Terminal Services, The Definitive Guide to MetaFrame XP, and co-author of the book Mastering Windows 2003 Server. If you have a scripting question for Christa, please e-mail her at editor@SearchWincomputing.com. She often uses these emails as fodder for her scripting columns.


Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.