Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7554987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:28:58+00:00 2026-05-30T11:28:58+00:00

I need a better solution for handling unready drives and want to be able

  • 0

I need a better solution for handling unready drives and want to be able to see and change files in my rw-drive. Unfortunately it always gives drive unready error and the only thing that I can do is handle the error.

So far I’ve done this:

My Drive:

Private Sub imperialdrive_Change()
    On Error GoTo I_have_a_baad_feeling_about_this
    imperialdir.Path = RootPathOnDrive(imperialdrive.Drive)
    Exit Sub

I_have_a_baad_feeling_about_this:
    If Err.Number = 68 Then
        MsgBox "The selected drive is not available at the moment.", vbOKOnly, "I feel a disturbance in the force."
    Else
        MsgBox Err.Number & " " & Err.Description, vbCritical, "There is a Bounty Hunter here."
    End If
End Sub

My Function:

'Such a bad choise for a function name
'It sounds like doing smt more than changing the name of drive lol
Public Function RootPathOnDrive(ByVal Drive)
    'So how it comes as "k:" instead of "k:\" Is it really cause its not ready? Both ways i should try reaching "k:\"
     RootPathOnDrive = Left(Drive, 1) & ":\"
End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:29:00+00:00Added an answer on May 30, 2026 at 11:29 am

    Have you looked into using the FileSystemObject that is part of the Microsoft Scripting Runtime (scrrun.dll)?

    Public Function CheckDrivePathReady(IN_sPath as String) As Boolean
        Dim myFSO As Scripting.FileSystemObject
        Dim myDrive As Scripting.Drive
        Dim myDriveName As String
    
        'Create a new FileSystemObject
        Set myFSO = New Scripting.FileSystemObject
    
        'Get drive name from path.
        myDriveName = gFSO.GetDriveName(IN_sPath)
        'Create a "Drive" object to test the properties of.
        Set myDrive = gFSO.GetDrive(myDriveName)
    
        'Test if the drive is usable.
        '(there are more properties than just "ready" that can be tested)
        If myDrive.IsReady Then
            'Work with ready drive here....
    
        End If
    
        'Make sure to clean up when done.
        set myDrive = Nothing
        Set myFSO = Nothing
    End Function
    

    You will need to include the Microsoft Scripting Runtime in your project references, but I have found the FileSystemObject to be invaluable when working with drives and paths.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project, and we're gonna need some better tools as it's
I need some recommendations how to work better with the same sprites using Cocos2d.
i need to identify who raise an exception to handle better str error, is
Which approach is better to use if I need a member (sp or func)
I need to redirect any URLs without www. to URLs with www. for better
How it is better to organise a large database of addresses? It is need
I have two basic interface-related concepts that I need to have a better understanding
There are things in ARM elf binaries I'd like to understand better. I need
I am a newbie in Obj-C. I need to learn this better so please
I'm creating a line chart control, and I need to write (or better say

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.