记得以前somebody发过VBS版的....
我的这个速度有点慢....
退出的时候请返回主选菜单,按"x" 退出,以便恢复命令提示符的默认窗口大小。-
- @echo off
- setlocal enabledelayedexpansion
- title 系统驱动情况查询
- echo 初始化 ...
- regsvr32 %windir%\system32\wshom.ocx /s
- set "wmic_registry=wmic /namespace:\\root\default path stdregprov call"
- for /f "usebackq skip=4 tokens=3 delims= " %%a in (
- `"%wmic_registry% getDWORDValue ^&H80000001,"Console","ScreenBufferSize""`
- ) do (
- set Default_size=%%a
- set Default_size=!Default_size:~0,-1!
- )
- if not exist %temp%\Default_size.tmp echo !Default_size!>%temp%\Default_size.tmp
- %wmic_registry% SetDWORDValue ^&H80000001,"Console","ScreenBufferSize","19661100" >nul
- cls
- if "%1" == "h" goto :loop
- mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",3)(window.close)&&exit
- :loop
- cls
- echo.
- echo.
- echo.
- echo. 系统驱动情况查询 By:lxzzr E-mail:lxzzr@21cn.com
- echo.
- echo.
- echo.
- echo.
- echo.
- set temp_m=
- set temp_n=
- set temp_l=
- set /p x=Please enter the filter criteria [0.State 1.Startmode x.exit]:
- if %x% == x (
- rem Default_size:19660880
- set /p Default_size=<%temp%\Default_size.tmp
- %wmic_registry% SetDWORDValue ^&H80000001,"Console","ScreenBufferSize","!Default_size!" >nul
- del %temp%\Default_size.tmp /q >nul 2>nul
- exit
- )
- if %x% == 0 (
- set name_a=State
- set /p a= [0.Stopped 1.Running]:
- if !a! == 0 set name_b=Stopped
- if !a! == 1 set name_b=Running
- goto :start_
- )
- if %x% == 1 (
- set name_a=startmode
- set /p b= [0.Auto 1.Manual 2.Disabled 3.Boot 4.System 5.unknown]:
- if !b! == 0 set name_b=Auto
- if !b! == 1 set name_b=Manual
- if !b! == 2 set name_b=Disabled
- if !b! == 3 set name_b=Boot
- if !b! == 4 set name_b=System
- if !b! == 5 set name_b=unknown
- goto :start_
- )
- goto :loop
- :start_
- echo.
- echo.
- (
- del %temp%\temp.tmp
- wmic sysdriver where %name_a%='%name_b%' get name>>%temp%\temp.tmp
- ) >nul 2>nul
- for /f %%a in ("%temp%\temp.tmp") do (
- if %%~za lss 10 (
- echo No one.
- goto :start__
- )
- )
- for /f "usebackq delims=" %%a in (
- `"wmic sysdriver where %name_a%='%name_b%' get name,State,startmode,pathname,ServiceType"`
- ) do (
- set /a temp_l+=1
- if !temp_l! == 1 (
- call echo.%%a LastModified Size Manufacturer and Version
- for /l %%i in (1,1,150) do set/p=━<nul
- )
- if !temp_l! gtr 1 (
- for /f "tokens=1,2 delims=:." %%m in ("%%a") do (
- set temp_m=%%m
- set temp_n=%%n
- set temp_m=!temp_m:~-1!
- set driver_path_m=!temp_m!:!temp_n!.sys
- set driver_path_wmi=!driver_path_m:\=\\!
- for /f "delims=" %%o in ("!driver_path_m!") do (
- set time_=%%~to
- )
- if defined time_ (
- for /f "skip=1 usebackq delims=" %%p in (
- `"wmic datafile where name="!driver_path_wmi!" get size,Manufacturer,Version"`
- ) do (
- set Manu_=%%p
- )
- ) else (
- set time_=
- set Manu_=
- )
- call echo.%%a !time_! !Manu_!
- )
- )
- )
- :start__
- for /l %%i in (1,1,150) do set/p=━<nul
- echo Done,Press any key to continue.
- pause>nul
- goto :loop
复制代码
|