- @echo off
- set "v1=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion"
- set "v2=HKLM\My_Hive\Microsoft\Windows NT\CurrentVersion"
- set "Hive=windows\system32\config\software"
- for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
- if /i "%%i:"=="%SystemDrive%" (
- for /f "tokens=1,2*" %%a in ('reg query "%v1%"') do (
- if /i "%%a"=="ProductName" (
- echo,分区:%%i
- echo,系统:%%c&echo,
- )
- )
- ) else if exist "%%i:\%Hive%" (
- reg load "HKLM\My_Hive" "%%i:\%Hive%" >nul
- for /f "tokens=1,2*" %%a in ('reg query "%v2%"') do (
- if /i "%%a"=="ProductName" (
- echo,分区:%%i
- echo,系统:%%c&echo,
- )
- )
- reg unload "HKLM\My_Hive" >nul
- )
- )
- pause
复制代码
|