Removing filter driver service with DeleteService gives me BSOD in next reboot

Hello everyone, what is the proper way of deleting a filter driver ? I want it to get deleted in the next reboot not right away.

I tried DeleteService but this still gives me BSOD after the next reboot with error INACCESSIBLE_BOOT_DEVICE when i delete the driver file.

But sysinternal’s autoruns is able to delete the service easily without giving BSOD, how does it do it?

One blog solves this by searching the GUID in the classes and deleting that as well : https://confidentialfiles.wordpress.com/2013/06/29/removing-filter-drivers/

but there has to a be an easier way?

You need to remove the UpperFilters or LowerFilters key that you created during install.

That’s all you need to do.

Peter