![]() |
|
Welcome to Vista Banter. You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to ask questions and reply to others posts, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact support. |
|
|||||||
| Networking with Windows Vista Networking issues and questions with Windows Vista. (microsoft.public.windows.vista.networking_sharing) |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I'm posting this here as it seems to be the right place. The printer is meant
to be shared and installed via IP, and I couldn't find anywhere better to post this.... Hello, I'm new to WSH programming, and I got a lil' problem that I can't seem to fix at all. I'm trying to make a scritp to install a printer via IP on the computer (trying to do this, to upgrade it later to install multiple printers instead of just one... if someone got a tutorial on this second part too, I'd be really happy if you link it to me please). The problem is... Here is the script: (I'm running this on Windows Vista) ' Script Start strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") objWMIService.Security_.Privileges.AddAsString "SeLoadDriverPrivilege", True Set objDriver = objWMIService.Get("Win32_PrinterDriver") objDriver.Name = "Xerox WorkCentre 7665 rev2 PCL6" objDriver.SupportedPlatform = "Windows NT x86" objDriver.Version = "3" objDriver.DriverPath = "C:\Teste\Driver WC7665\xpdprint.dll" objDriver.Infname = "C:\Teste\Driver WC7665\XLX75XL.inf" intResult = objDriver.AddPrinterDriver(objDriver) Set objPrinter = objWMIService.Get("Win32_Printer").SpawnInstance_ objPrinter.DriverName = "IMPAPEX###" objPrinter.PortName = "IP_10.0.1.72" objPrinter.DeviceID = "Xerox WorkCentre 7665" objPrinter.Location = "Location of printer" objPrinter.Network = True objPrinter.Shared = True objPrinter.Put_ Wscript.Echo "Instalado!" WScript.Quit ' Script Ends If I run the script, I get this error: Line: 23 Charact: 1 Error: Generic failure Code: 80041001 Origem: SWbemObjectEx That line is the objPrinter.Put_ command... ALL scripts I tried were crushed on that line... The printer port is already created, the path is correct, I'm doing this logged as Admin so I have all permissions, I've tried disabling Drivers signature (it was suggested by someone else) and it didn't work, I have tried many things, with no progress. Does anyone around knows what I could do to make it work? I can't seem to find anything about this error, like a solid solution for it. Thanks a lot in advance, Alexandre Taitson Moreira |