Thank you for the quick reply and the warm welcome.
I come from a age where starting a new thread was not done, when there's still a old one
I already figured out my problem by doing the following.
Changed this code:
ElseIf $option = 1 Then
$allocated = $drives[$i]
If DriveGetLabel($allocated) = $name Then
Return $allocated
EndIf
EndIf
To this code:
ElseIf $option = 1 Then
$allocated = $drives[$i]
$label = DriveGetLabel($allocated) ;Put the output into $label, which contains 0117ABCD
If StringInStr($label, $name) Then ;Check if part of $label contains $name, which in my case would be ABCD
Return $allocated
EndIf
EndIf
I also edited If Not $allocated part, because when using option 1, it will return 0 when no match is found.
So this:
If Not $allocated Then
Turned into this:
If Not $allocated Or $allocated = 0 Then
Again thank you for the quick reply, and I will make a new thread the next time.
//WB