Hello!

I want to share a local printer from a Terminal server session with a vbs
script.

Please help, I'm a real newbie to scripting.

Here is the part of my script that doesn't work... ;)

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer Where Name = 'PrinterName'")
For Each objPrinter in colInstalledPrinters
objPrinter.Shared = True
objPrinter.ShareName = Sharename
objPrinter.Put_
Next

I have the name of the printer in a variable and I want to put it in
'PrinterName' in ("Select * from Win32_Printer Where Name = 'PrinterName'")

I have a Win2003 box.

Many thanks.

Jesper