/build/static/layout/Breadcrumb_cap_w.png

VBSCRIPT - check installed printer status

Hello everyone,
I have a problem and maybe one of you is able to give me a hint, I have to package a HP driver suite for the model: HP Officejet Pro 8500 A910.
The package is nearly finished and the only thing where I am stucked is, that I have to check the printer status before uninstalling the package.
If I try to uninstall when the printer is connected the uninstall is not succesful, so I have to check if the printer is connected and if it is, I'll inform the user to unplug the damn thing from the USB.

I'll mention that I've google it, and I found some stuff but no script so far, worked in my case.

Cheers,
D.

0 Comments   [ + ] Show comments

Answers (7)

Posted by: aogilmor 13 years ago
9th Degree Black Belt
2
try prnmngr.vbs in your system32 directory.
Very useful. you can type cscript prnmngr.vbs /? to get a list of valid arguments.
Also in system32 are these vbs files,
prncnfg.vbs
prndrvr.vbs
prnjobs.vbs
prnmngr.vbs
prnport.vbs
prnqctl.vbs
Check 'em out
Posted by: anonymous_9363 13 years ago
Red Belt
0
Funny, because I Googled 'vbscript printer connected', browsed the second hit and got this.

Hard to know what other info you might want from a printer that isn't there, other than how thick the dust is on it...
Posted by: newdude 13 years ago
Senior Yellow Belt
0
Point "well made" (again) Scab about google being your friend BUT is it not better for this forum to be a "One Stop Shop" and to assist people with their problems instead of having to Google everything? If this was the case there would be no forums like this as all of the responses on it would be ... "Google it",....lets face it ...it wouldn't be a very good forum.
Posted by: pjgeutjens 13 years ago
Red Belt
0
Well Steve, since it looks to me like Ian actually googled it FOR the OP, and then pointed out the most promising result, I'd say job well done. No need imo to copy/paste the actual scripts here again, if you can just point to where to find it..

my 2c

PJ
Posted by: dryce 13 years ago
Senior Yellow Belt
0
sry for my late response, but as I mentioned in my post I said I did googled the issue, and what I found didnt worked for my problem.
That script which you found it, it works only if the printer is not installed YET, but in my case I have the printer isntalled and I have to check its status --> either its plugged or not in the USB ( Offline or Online). None of the Win32_Printer querries are returning any relevant information that could help me found out what I need.
The printer either is plugged or not ( Offline or Online status in Printer & Devices) if I querry Win32_Printer :PrinterStatus I alway get the Idle 'value'..so this is plain zero for me.
I found some more advanced stuff related to this which concerns some API calls, but I'm not sure if this can be handled via simple VBscript..

So if anyone can give me a hint ( not a complete solution lol) or some head start from another point than what you can find from the first result pages from google, feel free to share :)
Posted by: anonymous_9363 13 years ago
Red Belt
0
it works only if the printer is not installed YETEh?!? Explain how a script can retrieve Description, Driver name, horizontal and vertical resolution for a printer which isn't installed.

Ahm oot!
Posted by: dryce 13 years ago
Senior Yellow Belt
0
ORIGINAL: VBScab

it works only if the printer is not installed YETEh?!? Explain how a script can retrieve Description, Driver name, horizontal and vertical resolution for a printer which isn't installed.

Ahm oot!



:-)
What I meant is, if you just plug the printer ..ofcourse the windows recognize it and installs basic stuff --> querry those WMI classes --> you get the expected result.
IF you install all its HP suite ( for this device) --> querry WMI you get what I get --> 0

@aogilmor Thanks I'll go more deep into those.


LE: Somehow the HP Vendor MSI detects if the printer is online during uninstall ( and throws the message), and I have the feeling that the dll function used there is not querring WMI, so it must be some other way.

LLE: Well, I think I've wasted to much time on this last issue..I think I'll go with the: throw a MessageBox at the start of Uninstall, where I'll inform the user to be sure he has his device unplugged from the USB.

Thanks everyone.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ