Sunday, October 16, 2011

DefineDosDevice Virtual Drives!!


I started my career as Java developer in NIC. After working for 1 year and 3 months I switched to Uniken Systems. After 5 months in Uniken working on Java, I got chance to work on C++. Now I develop applications using C++, where I learn loads of new things. Yesterday itself I came to know about a new thing, not a new thing but a new API from C++ with the help of which we can create a virtual drive which actually points to a folder..
 Well some people might say so whats great in that! But for some people it can be a very great thing if you can mount your movies folder, songs folder and docs folder as drive. It can be very handy coz when you open your 'My Computer' folder you can see your virtually mounted drives..
API call - 


     DefineDosDevice
How to use it?
Here is an example -


     DefineDosDevice(0, _T("T:"), _T("F:\\Songs"));


And when you no longer require this drive you can remove it simply by using following call


     DefineDosDevice(DDD_REMOVE_DEFINITION, _T("T:"), _T("F:\\Songs"));

2 comments:

  1. U can do it through simple command on CMD
    subst
    eg : subst P: D:\songs

    ReplyDelete
  2. Thanks Rahul, I didn't know that..

    ReplyDelete

Ads Inside Post