天空小小岛技术网站

标题: dos 输出所有打印机名称 [打印本页]

作者: 一粒米    时间: 2011-12-28 11:28
标题: dos 输出所有打印机名称
以下内容另存到 .bat 的文件中,然后运行
  1. @echo off
  2. color 0a
  3. title    硬件检测      
  4. mode con cols=90
  5. sc config  winmgmt start= auto >nul 2<&1
  6. net start winmgmt 2>1nul
  7. setlocal  ENABLEDELAYEDEXPANSION
  8. echo 打印机:
  9. for /f "tokens=1,* delims==" %%a in ('wmic PRINTER get caption /value') do (
  10.     set /a tee+=1
  11.     if "!tee!" == "3" echo      打印机名字  = %%b
  12. )
  13. set tee=0

  14. pause
复制代码





欢迎光临 天空小小岛技术网站 (http://tkxxd.net/) Powered by Discuz! X3.1