Flush disk write cache from Windows CLI

杀马特。学长 韩版系。学妹 提交于 2019-12-09 08:54:05

问题


Does anyone know how to flush the disk write cache data from the cache manager for the current directory (or any given file or directory, for that matter), from a Windows command line?


回答1:


I found the SysInternals Sync worked well for me - although it flushes ALL cache, not just for the specific folder.

Example of usage:

IF EXIST Output RD /S /Q Output && Sync && MD Output

By default it flushes all cached data for all drives - you can specify command-line options to restrict which drives but you cannot restrict it to just specific folders.

Without it I would often get Access denied errors because the MD was trying to create a new folder while the system was still in the process of deleting the old one.



来源:https://stackoverflow.com/questions/85595/flush-disk-write-cache-from-windows-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!