Nov 26th, 2005, 12:54 PM
#1
Thread Starter
Junior Member
{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 .
Nov 26th, 2005, 01:12 PM
#2
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.
Nov 26th, 2005, 01:17 PM
#3
Thread Starter
Junior Member
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
Nov 26th, 2005, 01:27 PM
#4
Re: Creating Virtual Drives
Same here. My F: drive reports in as a DVD player, the same size as my C: drive
Nov 26th, 2005, 01:29 PM
#5
Thread Starter
Junior Member
Re: Creating Virtual Drives
Is there a way to create this in VB? They used C++ to do this.
Nov 26th, 2005, 02:49 PM
#6
Re: Creating Virtual Drives
Sure:
VB Code:
Private Declare Sub Sleep Lib "kernel32.dll" ( _
ByVal dwMilliseconds As Long _
)
Public Function MapVirtualDrive(sDriveLetter As String, sPath As String) As Boolean
'This function will try to map a virtual drive (sDriveLetter) to a physical path (sPath)
'Returns True on success
If Len(sDriveLetter)
sDriveLetter = Left$(sDriveLetter, 1) & ":"
If Len(Dir$(sPath, vbDirectory)) > 0 And Len(Dir$(sDriveLetter & "\", vbDirectory)) = 0 Then
Shell "subst " & sDriveLetter & " " & sPath, vbHide
Call Sleep(500)
MapVirtualDrive = (Len(Dir$(sDriveLetter & "\", vbDirectory)) > 0)
End If
End If
End Function
Nov 27th, 2005, 10:44 AM
#7
Thread Starter
Junior Member
Re: Creating Virtual Drives
that's a lot less code than i though i'd need,
Thanks,
Cory
Nov 27th, 2005, 10:44 AM
#8
Thread Starter
Junior Member
Re: Creating Virtual Drives
How Do You Un-Map or Kill a virtual drive?
Nov 27th, 2005, 10:58 AM
#9
Re: Creating Virtual Drives
VB Code:
Public Function UnmapVirtualDrive(ByVal sDriveLetter As String) As Boolean
If Len(sDriveLetter) Then
sDriveLetter = Left$(sDriveLetter) & ":"
If Len(Dir$(sDriveLetter & "\", vbDirectory)) Then
Shell "subst " & sDriveLetter & " /D", vbHide
Call Sleep(500)
UnmapVirtualDrive = (Len(Dir$(sDriveLetter & "\", vbDirectory)) = 0)
End If
End If
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
Forum Rules
Click Here to Expand Forum to Full Width