Phutho
Trả lời 16 năm trước
1. Bạn mở NotePad tạo file ví dụ có tên là : W2003R2.BAT có nội dung dưới đây :
2.
@echo off
setlocal ENABLEDELAYEDEXPANSION
set Edition=N
if {%1}=={} goto err1
if {%2}=={} goto get
set comp=%2
set comp=%comp:"=%
set comp=\\\\%comp:\\=%\\
if not exist %comp%c$ goto :err2
:get
set key=%comp%HKLM\\SOFTWARE\\Microsoft\\ServerAppliance
call :getedn>nul 2>&1
endlocal&set %1=%Edition%
endlocal
goto :EOF
:err1
@echo Syntax: W2K3R2Edition Edition [Comp]
endlocal
goto :EOF
:err2
@echo Syntax: W2K3R2Edition Edition [Comp] - %2 NOT found.
endlocal
goto :EOF
:getedn
for /f "tokens=1,3" %%a in ('reg query %key% /V Edition^|find /i "Edition"') do (
set Edition=%%b
)
set Edition=%Edition:0x=%
3.Lưu file trên và chạy trực tiếp nó
4.N - R2 không cài đặt
5.0 - Windows Storage Server 2003 R2, Express Edition
6.1 - Windows Storage Server 2003 R2, Workgroup Edition
7.2 - Windows Server 2003 R2, Standard Edition hoặc Windows Storage Server 2003 R2, Standard Edition
8.3 - Windows Server 2003 R2, Enterprise Edition hoặc Windows Storage Server 2003 R2, Enterprise Edition .
4 - Windows Server 2003 R2 Datacenter Edition