The AARD code was a segment of code in a beta release of Microsoft Windows 3.1 that would determine whether Windows was running on MS-DOS or PC DOS, rather than a competing workalike such as DR-DOS, and would result in a cryptic error message in the latter case. This XOR-encrypted, self-modifying, and deliberately obfuscated machine code used a variety of undocumented DOS structures and functions to perform its work, and appeared in the installer, WIN.COM and several other executables in the OS.
The AARD code was originally discovered by Geoff Chappell on 17 April 1992 and then further analyzed and documented in a joint effort with Andrew Schulman. The name was derived from Microsoft programmer Aaron R. Reynolds (1955–2008), who used "AARD" to sign his work; "AARD" was found in the machine code of the installer. Microsoft disabled the AARD code for the final release of Windows 3.1, but did not remove it, so that it could have become reactivated anytime later by the change of a single byte in an installed system, thereby constituting a "smoking gun".
DR-DOS publisher Digital Research released a patch to enable the AARD tests to pass on its operating system in 1992.
The rationale for the AARD code came to light when internal memos were released during the United States v. Microsoft antitrust case in 1999. Internal memos released by Microsoft revealed that the specific focus of these tests was DR-DOS. At one point, Microsoft CEO Bill Gates sent a memo to a number of employees, reading "You never sent me a response on the question of what things an app would do that would make it run with MSDOS and not run with DR-DOS. Is there feature [sic] they have that might get in our way?" Microsoft Senior Vice President Brad Silverberg later sent another memo, stating: "What the [user] is supposed to do is feel uncomfortable, and when he has bugs, suspect that the problem is DR-DOS and then go out to buy MS-DOS."