winver
Component of Microsoft Windows | |
Introduced in | Windows 3.0 |
---|
winver
, short for Windows Version, is a utility included in most versions of Microsoft Windows, used to obtain information about the operating system version. It is the Windows equivalent of the ver
MS-DOS command. Depending on the Windows version, the tool is also referred to as Windows-version utility or Version Reporter Applet in its file version information on DOS-based Windows and Windows NT, respectively.
History
The applet was first introduced in Windows 3.0, where it was implemented as a simple message box with the Windows logo, major and minor version number, copyright notice and information about the currently active mode of operation. The tool also includes a custom MS-DOS executable stub that prints the version information onto the screen. It was kept virtually unchanged throughout the DOS-based Windows series, with Windows 3.1 only changing the logo, and Windows 95 reducing the version information to the operating system name.
On NT-based Windows versions, the utility was included since Windows NT 3.1, where it was implemented similarly to its 16-bit counterpart, as a simple box with the Windows logo, version, build numbers and a copyright notice. However, starting with Windows NT 3.5, it merely displays the shell about box, which aside from the version and copyright notices also contained information about the computer, the registered owner and amount of RAM available for machine.
With the introduction of the timebomb mechanism during the development of Windows 2000, winver
was updated to query information about the timebomb, and if present, display it in the about box.
Implementation
Windows NT 3.5 and later
The applet is a simple wrapper around the ShellAbout
API that displays a common about box for Windows components. Additionally, since Windows 2000, winver.exe
checks for the presence of a timebomb by querying the system expiration date field in the user shared data structure. If present, it prints the expiration date via the szOtherStuff
parameter.
On Windows versions that don't include a standalone winver.exe
executable, such as Windows Server Core or the Windows Preinstallation Environment, the dialog can be invoked using the rundll32 shell32,ShellAbout
command. However, when invoked this way, the dialog won't include timebomb information, as that functionality is exclusive to the applet. The dialog caption will show garbled characters when invoked in that way, due to the differences between the arguments expected by rundll32
and the actual signature of the function.[a]
Gallery
Classic Windows
Windows for Workgroups 3.11 (from DOS)
Windows NT
Notes
- ↑
rundll32
expects the called function to have the signature ofvoid CALLBACK EntryPoint (HWND hWnd, HINSTANCE hInst, LPSTR lpszCmdLine, int nCmdShow)
. The garbled application name in the title bar (MZ
or mojibake, depending on whether the -A or -W variant of the API is used) is a result ofShellAbout
trying to parse the executable header ofshell32.dll
as a null-terminated string. This is caused by a mismatch of the second parameter, whereShellAbout
expects a pointer to a string whilerundll32
provides the DLL'sHINSTANCE
, which in Win32 is a pointer to the loaded module in memory.