🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.ms-windows.programmer.networks
4 messages
4 total messages Started by Patrick Whittle Fri, 19 Jan 1996 23:06
NetBIOS Path Strings and Drive Letter Assignments
#9
Author: Patrick Whittle
Date: Fri, 19 Jan 1996 23:06
26 lines
1366 bytes
Hi:

I am developing an application that accesses a share on our server 
using a NetBIOS path string (i.e. \\SHARE\NAME\<path>\file.ext). 
I want to use this path string because the share name will not change,

whereas the drive letter assignment a given user uses could at any 
time change. However, there is still a situation where I could make 
use of an API call that returns a drive letter being used.

Do you know of an API call that returns network drive letter 
assignments?  Is there a way to find out what drive is connected to 
\\SHARE\NAME for example, using the API interface??

Please respond to patrick@xiris.com

Thanks ......... PW



///////////////////////////////////////////
Patrick Whittle        Tel: (905) 681-8107
  Xiris Inc.           FAX: (905) 681-9844

E-mail:                patrick@xiris.com
Web Page:              http://www.hookup.net/~xiris/
Re: NetBIOS Path Strings and Drive Letter Assignments
#11
Author: Michael Washington
Date: Mon, 22 Jan 1996 08:26
51 lines
2646 bytes
> 
> NetBIOS Path Strings and Drive Letter Assignments
> 
> patrick@xiris.com (Patrick Whittle)
> Fri, 19 Jan 1996 23:06:52 GMT
> Xiris Incorporated
> Newsgroups:
> 
comp.os.ms-windows.programmer.networks,comp.os.ms-windows.programmer.mis
c,comp.lang.c,comp.lang.basic.visual.database
> 
> Hi:
> I am developing an application that accesses a share on our server 
> using a NetBIOS path string (i.e. \\SHARE\NAME\<path>\file.ext). 
> I want to use this path string because the share name will not change,
> whereas the drive letter assignment a given user uses could at any 
> time change. However, there is still a situation where I could make 
> use of an API call that returns a drive letter being used.
> Do you know of an API call that returns network drive letter 
> assignments?  Is there a way to find out what drive is connected to 
> \\SHARE\NAME for example, using the API interface??
> Please respond to patrick@xiris.com
> Thanks ......... PW
> ///////////////////////////////////////////
> Patrick Whittle        Tel: (905) 681-8107
>   Xiris Inc.           FAX: (905) 681-9844
> E-mail:                patrick@xiris.com
> Web Page:              http://www.hookup.net/~xiris/

If your network supports UNC you don't need to worry about finding the 
next available drive letter. If it does not try using the following 
function from the Microsoft knowledge base it uses the Win API 
GETDRIVETYPE.

Declare Function GetDriveType Lib "kernel" (ByVal nDrive As Integer) As 
Integer

Function Freedrv()
 Dim DriveNum As Integer, FirstFreeDrive As String
 Dim FirstDrive As Integer
 DriveNum = -1
 Do 
   DriveNum = DriveNum +1  'start at drive zero
   FirstDrive% = GetDriveType(DriveNum)
   'GetDriveType returns zero if it cannot determine drive
   'type or returns 1 if the specified drive does not exists
 Loop Until FirstDrive% = 0
 'DriveNum of 0 means Drive A, 1=B, 2=C, 3=D , and so on
 FirstFreeDrive = Chr$(DriveNum+65) & ":"
 FreeDrv = FristFreeDrive
End Function
Re: NetBIOS Path Strings and Drive Letter Assignments
#10
Author: Pauwl Lunow
Date: Mon, 22 Jan 1996 09:12
44 lines
1920 bytes
patrick@xiris.com (Patrick Whittle) wrote:
>Hi:
>
>I am developing an application that accesses a share on our server 
>using a NetBIOS path string (i.e. \\SHARE\NAME\<path>\file.ext). 
>I want to use this path string because the share name will not change,
>
>whereas the drive letter assignment a given user uses could at any 
>time change. However, there is still a situation where I could make 
>use of an API call that returns a drive letter being used.
>
>Do you know of an API call that returns network drive letter 
>assignments?  Is there a way to find out what drive is connected to 
>\\SHARE\NAME for example, using the API interface??
>
>Please respond to patrick@xiris.com
>
>Thanks ......... PW
>
[snip]


Patrick,

I'm doing much the same, but the software I'm writing has to run on 
MS-DOS clients too. How about the following:

1) I don't connect the share (\\<server>\<share>) to a drive letter
   at all. Just connect it! To simulate this easily, try:

   NET USE \\<server>\<share> <password>
   and then type
   NET USE
   to ensure you've got what you want.

   I make this connection by using MS-DOS Int21 5f03.

2) To get a list of the already connected devices, use Int21 5f02. This
   even can tell you which drive it is.

Hope this helps.

------
Pauwl
Re: NetBIOS Path Strings and Drive Letter Assignments
#12
Author: John Murphy
Date: Mon, 22 Jan 1996 19:11
19 lines
1272 bytes
In article <4dp4l2$bcf@noc.tor.hookup.net>, patrick@xiris.com says...
>
>Hi:
>
>I am developing an application that accesses a share on our server 
>using a NetBIOS path string (i.e. \\SHARE\NAME\<path>\file.ext). 
>I want to use this path string because the share name will not change,
>
>whereas the drive letter assignment a given user uses could at any 
>time change. However, there is still a situation where I could make 
>use of an API call that returns a drive letter being used.
>
>Do you know of an API call that returns network drive letter 
>assignments?  Is there a way to find out what drive is connected to 
>\\SHARE\NAME for example, using the API interface??
>
Check into Int21-5F02.

Murf
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads