Stopping “No Disk” Error Pop-up In Windows

While working on a project that used the Microchip C18 compiler I got this error message:-

If I clicked “Continue” it would appear again instantly, and this kept going dozens of times, the compile worked fine but the error message was very annoying. The drive in question was a partition on my main hard disk, it was not a removable drive!

After a bit of research I found out how to suppress the error message by modifying the system registry. Below is an example of the .reg file I created.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows]
"ErrorMode"=dword:00000002

This will disable all application and system error pop-ups, which may not be what you want so what I did is create two reg files, on disables the errors, the other enables the errors. This means I can temporarily disable the errors when I want.

For more information on this see this Microsoft support page.

WARNING! Modifying your system registry could be dangerous, proceed with caution. I am not responsible for any damage you cause to your system!

I recommend creating a system restore point before making any modifications to the system registry.