how to identify c drive exists in windows

Posted on 2014-08-04
Last Modified: 2014-08-09
i need to create the folder through java.Before creating the folder i need to check the Opertaing systen is linux or windows?
If it is windows then check c:\ drive exists and create folder in that?
how to identify c:\exists in windows
Question by:Rocking
    LVL 86

    Accepted Solution


    Use ""

    boolean cExists = new File("C:/").exists();

    Open in new window


    Author Comment

    in case if the c: drive does not exists and i need to create a folder on that system.
    how to identify which drives exists in windows?
    LVL 86

    Expert Comment


    I don't think it's even possible for C: to be absent actually
    LVL 86

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
    By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
    This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    759 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

    8 Experts available now in Live!

    Get 1:1 Help Now