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.
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.