Now have got error
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: '[string: "\\Server\Printer"]'
/printer.asp, line 3
Main Topics
Browse All TopicsWhen I try to run this and other WSH scripts I get this error.
Any Idea?
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'WScript'
<%
Set NWPrinter = WScript.CreateObject("WScr
Set NWPPath = "\\Server\Printer"
NWPrinter.AddWindowsPrinte
Set rc = NWPrinter.AddWindowsPrinte
If Not rc then
WScript.Echo("Unable to install printer at this time.")
End If
NWPrinter.SetDefaultPrinte
%>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Now have got a very helpful error.
Error Type:
(0x80070709)
/printer.asp, line 4
<%
Set NWPrinter = Server.CreateObject("WScri
NWPPath = "\\server\Printer"
Set rc = NWPrinter.AddWindowsPrinte
If Not rc then
WScript.Echo("Unable to install printer at this time.")
End If
NWPrinter.SetDefaultPrinte
Set NWPrinter = Nothing
%>
How about this?
<%
On Error Resume Next
Set NWPrinter = Server.CreateObject("WScri
NWPPath = "\\server\Printer"
NWPrinter.AddWindowsPrinte
If Err.Count <> 0 Then
Response.Write "Unable to install printer at this time."
Else
NWPrinter.SetDefaultPrinte
End If
Set NWPrinter = Nothing
%>
hongjun
After reinstalling the server and installing WScript 5.6 I tried it again.
The code to install the printer only work's when running through a VBS file & not via ASP. I believe this is a limitation to WScript 5.6. I can use other functions of the OCX ok Like mapping & unmapping network drives viewing network shares etc.
The MSN community is quite good.
http://communities.msn.com
Business Accounts
Answer for Membership
by: hongjunPosted on 2001-09-15 at 09:06:35ID: 6484743
Try this
pt.Network ")
<%
Set NWPrinter = Server.CreateObject("WScri
'''''
%>
hongjun