Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
So I've been beating my head against MSDN and WMI documentation and am not having any luck whatsoever!! Does anybody know if there is a method to intialize a raw disk, and create a volume on it all from within a c# program?

I've worked with Win32_disk and friends, but really it seems that the only thing WMI is good for is retrieving info, you can't really "do" anything with it.

Anyway, I'm almost ready to resort to making calls to diskpart from within my program, but with the diskpart shell I'm sure that will be interesting as well.
Posted
Comments
Toli Cuturicu 26-Aug-10 10:50am    
You are right. WMI only gets stuff. You can't set anything.

1 solution

I am not sure that C# security sandbox allows such things. I think the best way is to call external utility which should be shipped with your program.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900