/build/static/layout/Breadcrumb_cap_w.png

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?

0 Comments   [ + ] Show comments

Answers (3)

Posted by: anonymous_9363 13 years ago
Red Belt
0
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
Fifth Degree Brown Belt
0
thank you for replay, but the problem is that i dont know the next drive wich is free, so i thogt that there is some other posibility to add neded drive with out knowing the numbers of allredy existing drives.
Posted by: anonymous_9363 13 years ago
Red Belt
0
The code I sent you is the shell of a script which will do exactly that. It loops through all the drives starting with Z and ending with Eand attempts to map a drive to the sharename passed in to the function. If it succeeds, the drive letter is returned by the function.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ