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.
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)
Please log in to answer
Posted by:
aogilmor
13 years ago
Posted by:
anonymous_9363
13 years ago
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...
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
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
Posted by:
dryce
13 years ago
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 :)
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
Posted by:
dryce
13 years ago
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.
so that the conversation will remain readable.