www.pudn.com > virtualdrivemapper.zip > frmBoot.frm


VERSION 5.00 
Begin VB.Form frmBoot  
   BorderStyle     =   3  'Fixed Dialog 
   ClientHeight    =   1890 
   ClientLeft      =   255 
   ClientTop       =   1410 
   ClientWidth     =   4335 
   ClipControls    =   0   'False 
   ControlBox      =   0   'False 
   Icon            =   "frmBoot.frx":0000 
   KeyPreview      =   -1  'True 
   LinkTopic       =   "Form2" 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   1890 
   ScaleWidth      =   4335 
   ShowInTaskbar   =   0   'False 
   StartUpPosition =   2  'CenterScreen 
   Begin VB.Frame Frame1  
      Caption         =   "vDrive 1.0  .:: Booting up::." 
      Height          =   1890 
      Left            =   0 
      TabIndex        =   0 
      Top             =   0 
      Width           =   4320 
      Begin VB.Timer tmr  
         Interval        =   700 
         Left            =   3000 
         Top             =   240 
      End 
      Begin VB.Label lblMsg  
         Alignment       =   2  'Center 
         BorderStyle     =   1  'Fixed Single 
         BeginProperty Font  
            Name            =   "Arial" 
            Size            =   14.25 
            Charset         =   0 
            Weight          =   400 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         Height          =   375 
         Left            =   120 
         TabIndex        =   1 
         Top             =   720 
         Width           =   4095 
      End 
   End 
End 
Attribute VB_Name = "frmBoot" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
'///////////////////////////////////////////////////////// 
'Copyright © 2001 B.O.O.P.S. Inc. 
'BOOPS, Based On Other People's Stuff 
'We don't code the source you download, we code it better. 
'Original only in the synthesis. 
' 
'This program is based on Ian O'Connor's(oc@lineone.net) vb script file 
'"Directory Mapping.vbs" with revisions by Neil Ramsbottom(nramsbottom@hotmail.com). 
'It was included in the zip. 
'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 
Option Explicit 
Private R As New cReg 
Dim Dat As Byte, msg As String 
 
Private Sub Form_Load() 
tmr.Enabled = True 
End Sub 
Private Sub vDrive() 
Dim numVdrv As String, keys() As String, i As Integer, mapFld As String 
 
If R.ValRegKey(&H80000001, "Software\BOOPS", "Loaded") <> True Then 
    msg = "No vDrives found." 
    Exit Sub 
End If 
numVdrv = R.qVal(&H80000001, "Software\BOOPS", "Loaded") 
 
If numVdrv = "0" Then 
    msg = "No vDrives loaded." 
    Exit Sub 
End If 
 
'Load array with loaded vDrives, then map them. 
keys() = R.EnumRegKeys(&H80000001, "Software\BOOPS") 
For i = LBound(keys()) To UBound(keys()) 
    mapFld = R.qVal(&H80000001, "Software\BOOPS\" & keys(i), "vMap") 
    loadVdrv keys(i), mapFld 
Next 
msg = "Your vDrives have been loaded." 
 
End Sub 
Private Sub loadVdrv(drv As String, mapPath As String) 
Dim filesys, wsh 
Set filesys = CreateObject("Scripting.FileSystemObject") 
Set wsh = CreateObject("WScript.Shell") 
wsh.Run ("subst " & drv & " " & mapPath) 
DoEvents 
Set filesys = Nothing 
Set wsh = Nothing 
End Sub 
Private Sub tmr_Timer() 
Select Case Dat 
    Case 0: 
        lblMsg.Caption = "Searching For Virtual Drives..." 
        vDrive 
        Dat = Dat + 1 
    Case 1: 
        lblMsg.Caption = msg 
        Dat = Dat + 1 
    Case 2: 
        Unload Me 
End Select 
End Sub