Enable Write Caching for a Removable Drive (Programmatically)

Posted on 2011-05-09
Last Modified: 2012-05-11
Anyone have any idea how to programmatically enable write caching for a removable drive in windows 7 using .NET 2.0?

Equivalent of going to Computer Management -> Storage -> Disk Management -> Properties for a Removable drive -> Policies -> "Better Performance"

Question by:collages
    LVL 2

    Assisted Solution

    You won't be able to do it now through managed calls in the framework.
    Rather, you will have to call the APIs you would call in other environments
    through the P/Invoke layer.
    LVL 14

    Accepted Solution

    One solution should be looking in the registry and change/create the UserRemovalPolicy=3 in

    Look here the code is ni vbscript (but you can use the language you prefer)
    LVL 1

    Author Closing Comment

    Both of these are excellent answers and resources.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now