简体   繁体   English

如何禁用在Windows MFC应用程序中创建.pf(预取)文件的功能?

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

I'm writing a C++ MFC application. 我正在编写一个C ++ MFC应用程序。 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\\ . 当我打开应用程序时,Windows立即在目录..\\Windows\\Prefetch\\创建一个.pf文件。

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. 我无法禁用负责预取的注册表值( HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management\\PrefetchParameters\\EnablePrefetcher ),因为我的应用程序必须在许多不同的计算机上运行,​​并且某些用户甚至不知道如何运行运行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 . 描述停止SuperFetch的服务在这里 I would try this in InitInstance . 我会在InitInstance尝试。 If that proves to be too late, I would stop the service before the software is run. 如果事实证明为时已晚,我将在运行软件之前停止该服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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