简体   繁体   中英

How to disable creating .pf (prefetch) file in Windows MFC application?

I'm writing a C++ MFC application. I want to avoid writing any data on HDD during program execution.

When I open up my application, Windows immediately creates a .pf file in a directory ..\\Windows\\Prefetch\\ .

I cannot disable registry value responsible for prefetching ( HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management\\PrefetchParameters\\EnablePrefetcher ), because my application has to run on many different machines, and some of users may don't even know how to run regedit.

Could you tell me if there is any option to disable creating this file in my application?

Stop the SuperFetch service as described here . I would try this in InitInstance . If that proves to be too late, I would stop the service before the software is run.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM