Add virtual drive in daemon tool
Hi,
i have a problem with creation daemon tool, the problem is that i need some how do that that after installing it it takes as virtual drive example V:\ drive, so is it posible to manage that in the MSI file. On PC could be some different drives posible but many of them and the V:\ drive is not used, so is it posible to do that?
i have a problem with creation daemon tool, the problem is that i need some how do that that after installing it it takes as virtual drive example V:\ drive, so is it posible to manage that in the MSI file. On PC could be some different drives posible but many of them and the V:\ drive is not used, so is it posible to do that?
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
anonymous_9363
13 years ago
Reading between the lines, I *think* you're asking how to determine which drive is free to map a share to? Here's some ancient code I used to use. It doesn't fit my current specifications for script code but it does the job:
lstrDummy = strGetNextAvailableDrive(lstrDrive)
If lstrDummy = "" Then
'// Display an error and bail
Else
lstrDrive = lstrDummy
End If
Private Function strGetNextAvailableDrive(ByVal lstrShare)
'********************************************************************
'*
'* Gets the next drive letter available from OS to map to a share
'*
'* Input: lstrShare the name of the share to map drive to
'*
'* Output: None
'*
'* Returns: strGetNextAvailableDrive the drive letter to map to
'*
'********************************************************************
On Error Resume Next
Dim lintDrive
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
For lintDrive = 26 To 5 Step -1
If blnTryMapDrive(lintDrive, lstrShare) Then
Exit For
End If
Next
If lintDrive <= 5 Then
strGetNextAvailableDrive = ""
strMsg = "Unable to verify availability of " & lstrShare
Else
strGetNextAvailableDrive = Chr(lintDrive + 64) & ":"
End If
Set fso = Nothing
On Error Goto 0
End Function
Private Function blnTryMapDrive(ByVal lintDrive, ByVal lstrShare)
'********************************************************************
'*
'* Attempts to map a network drive
'*
'* Input: lintDrive an integer between 5 and 26
'* lstrShare the name of the share to map drive to
'*
'* Output: None
'*
'* Returns: True if mapping successful
'* False if not
'*
'********************************************************************
On Error Resume Next
Dim lstrDrive
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
lstrDrive = Chr(lintDrive + 64) & ":"
blnTryMapDrive = False
' don't bother on existing drive, because that will DEFINITELY fail!
If Not fso.DriveExists(lstrDrive) Then
On Error Resume Next
objWshNetwork.MapNetworkDrive lstrDrive, lstrShare
If blnErrorOccurred(" occurred in mapping network drive") = False Then
blnTryMapDrive = True
End If
End If
Set fso = Nothing
On Error Goto 0
End Function
Posted by:
lanselots
13 years ago
Posted by:
anonymous_9363
13 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.