To run this machine on NT 4.0 machines you also need pdh.dll installed. If its missing use the version in the ZIP.
The file ieinfo.dat must also be installed in the same folder as cmdinfo.exe.
Switch %errorlevel% values used. You can only use ONE switch (as only one errorlevel can
/b Actually returns the build number, e.g. 2031
/sp Returns the Service pack number, e.g. 3 for SP3, 4 for SP4 etc
0 for unknown
/t Type of installation
1=Windows NT 4.0 Workstation
2=Windows NT 4.0 Server
3=Windows NT 4.0 Server Domain Controller
4=Windows NT 4.0 Terminal Server Edition
5=Windows NT 4.0 Enterprise Edition
6=Windows 2000 Professional
7=Windows 2000 Server
8=Windows 2000 Advanced Server
9=Windows 2000 DataCenter
10=Windows XP Home Edition
11=Windows XP Professional
12=Windows 2002 Server
13=Windows 2002 Advanced Server
14=Windows 2002 Datacenter
15=Windows NT 3.51 Workstation
16=Windows NT 3.51 Server
17=Windows NT 3.51 Server Domain Controller
(DC) at the end means its a domain controller
(TS) at the end means terminal services component is installed
/ed Length of limited version in days, e.g. 120
/tr Installation type, full, NFR or trial
2=Not For Resale
/ac Activated status
Any positive number means not activated and is the number of days left to activate (even 0)
/dc If a domain controller
/ts If has terminal services
/up Uptime in seconds (this will not work against 3.51 or lower machines). To work locally on NT 4.0 pdh.dll must be installed
/ie Internet Explorer Version. This only shows the major version, so IE 5.5 would just be 5
Allows a check if a certain hotfix is installed
/? Basic help (not much though :-) )
You can just use cmdinfo with no switch for a basic PC summary. The next major version will
support the querying of remote machines.
Note: For the type no difference is used for a domain controller or normal server for Windows 2000. If you need to
know if its a server/domain controller use /r.
Below is a basic batch file to use cmdinfo to test for service pack:
IF ERRORLEVEL 5 GOTO SP5
IF ERRORLEVEL 4 GOTO SP4
IF ERRORLEVEL 3 GOTO SP3
IF ERRORLEVEL 2 GOTO SP2
IF ERRORLEVEL 1 GOTO SP1
IF ERRORLEVEL 0 GOTO SP0
ECHO Service Pack 5 is installed on this NT computer.
ECHO No further upgrades are necessary.
ECHO Service Pack 4 is installed on this NT computer.
ECHO Press any key to install Service Pack 5...
PAUSE > NUL
rem Let's assume drive X: is mapped to a sharepoint...
rem X:\SP5\UPDATE\UPDATE.EXE -u -f -o
rem (etc. ...)