Results 1 to 9 of 9

Thread: {RESOLVED} Creating Virtual Drives

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Location
    Bentonville, AR
    Posts
    22

    {RESOLVED} Creating Virtual Drives

    I installed a program that created virtual drives. It created two drives that simply are alias' to my C drive. They aren't network drives which is why i'm baffled.

    If anyone has a way to create and remove them, please tell.

    Cory
    Last edited by corydg; Nov 29th, 2005 at 12:10 AM.

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Creating Virtual Drives

    I have Daemon Tools, which lets me use IMG files as a virtual drive, so that I don't have to burn a CD in order to install something.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Location
    Bentonville, AR
    Posts
    22

    Re: Creating Virtual Drives

    I noticed that each of the drives point to a specfic like G point to C:\Spots and R point to C:\Cuts.

    They are masked to look like their own drives, but they aren't. the capacity of them is the same as my C drive and the amount used is the same also.

    They work just like normal hard drives, but they're not physical drives.

    C
    Attached Images Attached Images  

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Creating Virtual Drives

    Same here. My F: drive reports in as a DVD player, the same size as my C: drive

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Location
    Bentonville, AR
    Posts
    22

    Re: Creating Virtual Drives

    Is there a way to create this in VB? They used C++ to do this.

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Creating Virtual Drives

    Sure:
    VB Code:
    1. Private Declare Sub Sleep Lib "kernel32.dll" ( _
    2.     ByVal dwMilliseconds As Long _
    3. )
    4.  
    5. Public Function MapVirtualDrive(sDriveLetter As String, sPath As String) As Boolean
    6.     'This function will try to map a virtual drive (sDriveLetter) to a physical path (sPath)
    7.     'Returns True on success
    8.     If Len(sDriveLetter)
    9.         sDriveLetter = Left$(sDriveLetter, 1) & ":"
    10.         If Len(Dir$(sPath, vbDirectory)) > 0 And Len(Dir$(sDriveLetter & "\", vbDirectory)) = 0 Then
    11.             Shell "subst " & sDriveLetter & " " & sPath, vbHide
    12.             Call Sleep(500)
    13.             MapVirtualDrive = (Len(Dir$(sDriveLetter & "\", vbDirectory)) > 0)
    14.         End If
    15.     End If
    16. End Function

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Location
    Bentonville, AR
    Posts
    22

    Re: Creating Virtual Drives

    that's a lot less code than i though i'd need,

    Thanks,

    Cory

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Nov 2005
    Location
    Bentonville, AR
    Posts
    22

    Re: Creating Virtual Drives

    How Do You Un-Map or Kill a virtual drive?

  9. #9
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Creating Virtual Drives

    VB Code:
    1. Public Function UnmapVirtualDrive(ByVal sDriveLetter As String) As Boolean
    2.     If Len(sDriveLetter) Then
    3.         sDriveLetter = Left$(sDriveLetter) & ":"
    4.         If Len(Dir$(sDriveLetter & "\", vbDirectory)) Then
    5.             Shell "subst " & sDriveLetter & " /D", vbHide
    6.             Call Sleep(500)
    7.             UnmapVirtualDrive = (Len(Dir$(sDriveLetter & "\", vbDirectory)) = 0)
    8.         End If
    9.     End If
    10. End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width