|
Very clunky, but:
for /f %i in ('net view') do net view %i | find "Print" >>result.txt
Explanation:
'net view' - command to display all sharing-enabled computers in a workgroup or domain.
'for /f %i ...' - for each line of result (%i) from 'net view', list the shares on that computer.
'| find "Print" - Pipe the preceding output through FIND.COM and look for the string "Print", indcating a shared printer.
'>>result.txt' - append the output to the file "result.txt", NOTE: >> to append, not > to write to or we'll only see the last positive match in our file.
The resulting file (result.txt in this case) will look something like:
[Netbios name, Service, Comment]
AC_PRN Print Accounts department multifunction
PR_DESJ Print Public Relations department Colour Deskjet
SH_DMP Print Shipping office dot-matrix label printer
Hope it helps.
If you want anything better I think you're going to have to look at some VB scripting and active directory-based looking-up.
Last edited by jallport; 03-28-2006 at 05:29 AM.
|