Firstly, did this start happening after you installed a progam/new device? If so, try uninstalling/reinstalling it.
(Remember to back up any imprtant files before tinkering with Windows!)
If there is no pattern then the laborious way is to remove devices/software one by one until it stops (does the message give a clue as to which file is causing the problem?)
Ultimately it may be easier to go for a full reinstall of the operating system.
(Trying not to sound patronising), BUT, don't delete/reinstall anything if you aren't sure what it is or what you're doing!! A simple click can render Windows unuseable!!