Avatar of SqueezeOJ
SqueezeOJ
Flag for United States of America asked on

How to Check Net Use Find LPT2 in DOS Batch File (.bat)?

Hello,

Writing short MS DOS batch (.bat) file for Windows XP and need to test result of NET USE.

Here's the pseudo-code of what I'd like to do...
NET USE | FIND "LPT2" --> Put Result Into LPT2-OK variable
IF LPT2-OK is TRUE
   THEN Issue Command
   ELSE Issue Another Command

Open in new window

What bat code would accomplish this?

Thanks,
Jason
Microsoft DOSWindows XPScripting Languages

Avatar of undefined
Last Comment
Paul Tomasi

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Paul Tomasi

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SqueezeOJ

ASKER
Fast. Easy. Complete.
Thanks!
Paul Tomasi

Thank you !! :)
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy