[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 384
  • Last Modified:

Printer VBScript Reversal

Our server is currently having an issue where it is trying to run a printer script and keeps gettinga SQL dialog box. We need to know how to reverse this script so it stops occuring. Your help is very important right now.

Thanks,

Nathan
0
murphyins
Asked:
murphyins
  • 13
  • 5
  • 2
  • +1
2 Solutions
 
murphyinsAuthor Commented:
In addition, we have a script that we normally use to remove all the printers that are on the script. When I try to run that script, I get this error where is says Line: 7, Char: 1, Error: 0x80041017, Code: 80041017, and Source: (null)
0
 
murphyinsAuthor Commented:
One more thing. The remove script works on all of our computers just not this server.
0
 
murphyinsAuthor Commented:
Here's the script

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colInstalledPrinters =  objWMIService.ExecQuery _
    ("Select * from Win32_Printer Where Network = TRUE")

For Each objPrinter in colInstalledPrinters
    objPrinter.Delete_
Next
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
puppydogbuddyCommented:
<<The remove script works on all of our computers just not this server. >>
Does your server have a printer attached to it?  The only pre-requisite is that you have a printer attached to the machine where you run the script.  Be aware, there may be a delay while the script checks all possible printer ports.

see this link for example wmi scripts:
          http://www.computerperformance.co.uk/vbscript/wmi_printer.htm
0
 
murphyinsAuthor Commented:
The printers are networked. When we orginally ran the script to add the printers, a SQL dialog box appeared and I will have to look at the error again.
0
 
murphyinsAuthor Commented:
Ok I have the SQL dialog box. It says across the top: Microsoft SQL Server Desktop Engine.
First Description: The feature you are trying to use is on a network resource that is unavailable.
Second Description: Click Ok to try again, or enter an alternate path to a folder containing the installation package 'SqlRun01.msi' in the box below
0
 
Dave2120Commented:
Not sure if this will help but are the computers you are trying to remove connected to a computer/server that is not turned on when you try to run the script? I have created drive mapping scripts in the past and they do not like it when they can't talk to networked printer.
0
 
Dave2120Commented:
Sorry; printers you are trying to remove.
0
 
murphyinsAuthor Commented:
They are connected to our servers which they are all on. This problem has been going on for a few weeks now. When I run the script I get that sql dialog box and when I run the removal, I get that error listed a few comments above.
0
 
puppydogbuddyCommented:
Per my original response, the reference source says "the only pre-requisite is that you have a printer attached to the machine where you run the script.  Be aware, there may be a delay while the script checks all possible printer ports."

I interpret that to mean the machine on which you are running the script must be physically connected to a printer.  

0
 
murphyinsAuthor Commented:
It isn't physically attached to the printer and neither is any of our other computers. This server is the only one that is having this issue. What I really want is for that dialog box to go away.
0
 
murphyinsAuthor Commented:
It don't really want it closed because the problem hasn't been resolved yet. I would just end up posting the same question again anyways.
0
 
murphyinsAuthor Commented:
I don't want it closed, read comment above
0
 
RobSampsonCommented:
Hi there,

This seems more or less related to the printer drivers that you might have installed:

http://social.msdn.microsoft.com/forums/en-US/sqldatabaseengine/thread/cc55c10b-d0e1-426b-b4dd-b2f305110fc6

Do you get the same message when you just open the Printers and Faxes control panel?  Or when you print from Word?

One probable fix is to upgrade the server driver to PostScript.....

On the other hand, if you don't care about the error, just add
On Error Resume Next
to the top of the script.

Regards,

Rob.
0
 
murphyinsAuthor Commented:
Yes I do get this message when I open the Printers and Faxes in the control panel.
0
 
RobSampsonCommented:
So you will have a driver problem then, most likely.

You will need to see if it is fixed by removing any problem drivers.

On the machine, logged in as Admin, delete all printer objects that you need to, then restart the Print Spooler service.  Right click in the Printers and Faxes dialog, and select Server Properties.  Go to the Drivers tab, and remove the problematic ones.  You may need to restart the print spooler service a few times in between.  Then reboot, and see if you can install the printer normally.

Regards,

Rob.
0
 
murphyinsAuthor Commented:
I did all of that. I am just waiting for an chance to reboot the server.
0
 
RobSampsonCommented:
Sure. Let me know.  You might want to check any clients that have the same problem too.

Rob.
0
 
murphyinsAuthor Commented:
All is well again, however, everytime I want to add the printer manually, it comes back so I have to delete it again to make the SQL dialog go away. I'm not sure what else I should try to get this printer installed on the server.
0
 
RobSampsonCommented:
Do you know which printer driver (and model) actually causes the problem?
0
 
murphyinsAuthor Commented:
I've found this to happen to no matter which printer I add. I just want the HP 2300 added.
0
 
RobSampsonCommented:
If you have the MSDE installed, you may need to look here:
http://support.microsoft.com/kb/311762

to find out where the installation source originally came from.  Then you might be able to point the dialog to that location when it prompts you for SQLRun01.msi, and it should complete the install.

If you do not have MSDE installed, you may need to run the Windows Installer Cleanup Utility.

Regards,

Rob.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 13
  • 5
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now