How to check if user entered the right drive

Posted on 2006-03-27
Last Modified: 2010-04-01

Hi Experts,

I have asked the question previously in

However, I am looking for something simple to check if the drive is there and writable.  What I need to do is to copy few files to a user supplied floppy or USB or any mapped drives.  I need to check quickly if the drive is valid before trying to copy the files.

What is the better way to do this.
Question by:thanesh
    1 Comment
    LVL 86

    Accepted Solution

    The easiest way would be to call 'GetDiskFreeSpace()' - if that reports 'no space', the drive is probably readonly. If the function failes, the drive isn't there.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

    746 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

    14 Experts available now in Live!

    Get 1:1 Help Now