Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Installing a new Printer

Closed Thread
 
Thread Tools Display Modes
Old 10-16-2006   #1 (permalink)
Jens Schulze
Guest


 

Installing a new Printer

Hello,
i wrote following Script to install a Printer-Driver. There is no Error, but
the Driver do not apear in the Dialog Printers & Fax from Windows. What ist
wrong?
How to install a new Port, I do know (thanks to /\/\o\/\/). The used port
exists.
Here ist my Code:

$strComputer = "."
$strDruckername="Brother HJ-100"
$strPortname="IP_169.254.110.15"
#Skriptbloecke und Funktionen
#Skriptinhalt

$objTreiber = [WmiClass]'Win32_PrinterDriver'
#erzeugen der neuen Instanz
$objNeuerTreiber=$objTreiber.CreateInstance()
$objNeuerTreiber.Name = $strDruckername
$objNeuerTreiber.SupportedPlatform = "Windows NT x86"
$objNeuerTreiber.Caption=($strDruckername + "-2")
$objNeuerTreiber.Version = 3
$erg = $objTreiber.AddPrinterDriver($objNeuerTreiber)
$erg=$objTreiber.Put()
#Treiber ist installiert, nun Drucker hinzufuegen
#Drucker-Klasse zurueckgeben
$objDrucker = [WmiClass]'Win32_Printer'
#Objekt erzeugen
$objNeuerDrucker=$objDrucker.CreateInstance()
#Eigenschaften festlegen
$objNeuerDrucker.Name=($strDruckername)
$objNeuerDrucker.Description="automatisch erzeugter Drucker"
$objNeuerDrucker.Portname=$strPortname
$objNeuerDrucker.DriverName=$strDruckername
$erg=$objDrucker.AddPrinterConnection(($strDruckername))
$objDrucker.Put()


Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Printer GFL4 Vista hardware & devices 2 03-12-2008 11:07 PM
Printer keeps re-installing gmaof3 Vista hardware & devices 2 01-08-2008 11:06 AM
installing a printer Aljr595 Vista print fax & scan 1 11-03-2007 08:49 PM
Installing the printer AnnB. Vista print fax & scan 2 10-11-2007 12:44 PM
Creating new Printer-Port and installing new Printer Jens Schulze PowerShell 3 10-11-2006 02:18 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50