In news:up8X%23%23gwKHA.732@TK2MSFTNGP06.phx.gbl,
Keith G Hicks <krh@comcast.net> typed:
> Is there some sort of command line tool that will let me check for the
> existence of an installed printer? I knwo I can use Prnmngr.vbs and
> related tools but they give me too much information. I'm hoping
> there's something simpler that will just confirm if a printer is
> installed or not.
Part of the power of Unix/Linux is its ability to redirect input/output
using pipes, which allows one to take the output of one command and use it
as input for another, etc. M$ has at least learned to do that to a very
limited extent, certainly nowhere near the functionality of such simple
tools as grep, awk and sed.
The M$ "find" command will let you search the Prnmngr.vbs output for the
item of interest, which can be assigned to a variable, compared and used for
further processing. A simple illustration will suggest a solution for your
needs, since by implication you seem competent at scripting:
D
> dir /s
.... (lengthy file listing expunged)
Total Files Listed:
100930 File(s) 15,387,877,309 bytes
24543 Dir(s) 18,508,480,512 bytes free
D
> dir /s | find "well"
09/04/2001 20
1 153,540 wellington_gateway_1.jpg
09/04/2001 20
5 186,802 wellington_gateway_2.jpg
09/04/2001 20
8 152,034 wellington_gateway_3.jpg
09/04/2001 20:45 181,920 wellington_gateway_4.jpg
09/04/2001 20:48 185,854 wellington_gateway_5.jpg
09/04/2001 20:51 208,789 wellington_gateway_6.jpg