简体   繁体   中英

Windows 7 Embedded - Disable Disk Caching Programmatically:

Preface:

We are using a Windows-7-Embedded image, for making client-ready copies of our software.

The flow is pretty standard:

  1. Take a blank hard-drive.
  2. Restore an in-house Windows-7-Embedded image on the hard-drive.
  3. Install additional software on-top.
  4. Hard-drive ready!

The Problem:

Sometimes, probably due to system crashes, some configurations that are already configured inside the image - reset.

My current problem is with a 'Disable Write Caching' option on the disk. In the image, the option is off . Sometimes, it just resets and turns on .

My Question:

How can I programmatically disable the disk write caching property?

Design Restrictions:

  • Can run an.exe on startup. The system is mostly c++ so that is that would be the optimal language for a code based solution.
  • Can run a.bat file.
  • can run a.vbs file. Not sure which version our current infrastructure are compatible with.

Images (Inside Image -> After Crash):

磁盘写入缓存选项关闭 磁盘写入缓存选项打开

Clarifications:

  • Did my research. did not find anything related to windows write caching option in SO or SE as a whole. Did find a bunch of linux related questions.
  • The system crashes are by-design, at the moment. This is the obvious root cause, but cannot be fixed due to design restrictions and budget issues.

There is a registry setting EnableCache you may try to experiment with. It applies to FAT file systems and setting it to 0 shall theoretically disable disk caching. Though I have not tested it.

Look into: HKEY_LOCAL_MACHINE\SYSTEM\StorageManager\FATFS or HKEY_LOCAL_MACHINE\SYSTEM\StorageManager\EXFAT

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