Enable Write Caching for a Removable Drive (Programmatically)

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"


LVL 1
collagesAsked:
Who is Participating?
 
canaliCommented:
One solution should be looking in the registry and change/create the UserRemovalPolicy=3 in
hklm\SYSTEM\CurrentControlSet\Enum\IDE


Look here the code is ni vbscript (but you can use the language you prefer)
 http://www.pcreview.co.uk/forums/wmi-script-issue-t2328822.html
0
 
ExpertHelp79Commented:
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.


http://msdn.microsoft.com/en-us/library/aa375082%28VS.85%29.aspx
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2cc30a64-ea15-4661-8da4-55bbc145c30e&displaylang=en
0
 
collagesAuthor Commented:
Both of these are excellent answers and resources.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.