How did I share a printer using vbscript in windows 2000?

F

feb

Hi,
How did I share a printer using vbscript in windows 2000?

I need to share a printer using vbscript in windows 2000, the script will
run in login domain script , only one time.
the script will reside in the server ( windows 2000), clients are windows
2000 Professional.
the printer is attached to client computer.
I try the following script, but it doesn't work, I think the problem is that
it is for windows xp and 2003.
*************** START OF SCRIPT *************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colInstalledPrinters = objWMIService.ExecQuery _
("Select * from Win32_Printer")
For Each objPrinter in colInstalledPrinters
Wscript.Echo "Name: " & objPrinter.Name
wscript.echo "SHARED " & objPrinter.Shared
wscript.echo "SHARED AS " & objPrinter.ShareName
Next
********************** END OF SCRIPT **********************
I get the following error
Error: The object doesn't accept this property o method: 'objPrinter.Shared'
Code: 800A01B6
......

thanks
feb.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top