You might have reason to do this, here’s how I did it (there are slight variations elsewhere online).
- Set the following registry value:
HKLM\SYSTEM\CurrentControlSet\services\TCPIP6\Parameters\DisabledComponents = 0xFF
After the reboot you can check that IPv6 is not working by issuing ipconfig /all and noticing the complete lack of IPv6 in the output. Your machine will also remove any IPv6 entries it might have previously placed into Windows dynamic DNS, leaving only IPv4.
You can do this using the following command:
reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents /t REG_DWORD /d 0xff
Note that this works on later Windows OS too.
Edit: 2016-10-21 to correct hex value to preferred FF (was FFFFFFFF), and add extra info inc. reg.exe command line.