Link to home
Start Free TrialLog in
Avatar of kcleary
kcleary

asked on

API to find out server info

I'm looking for a way to find out the root file server that I'm connected.  We are currently running on a Novell network, in transition to Windows 2000. If there's a API or OCX that will do the trick for both, that would be ideal. However, I'm guessing that it'll be 2 different ones.
Avatar of falkor
falkor
Flag of United States of America image


'try this
Sub main()
    Dim iCtr As Integer
   
    For iCtr = 1 To 28
        Debug.Print iCtr & " = " & Environ$(iCtr)
    Next iCtr
   
    'once you decide on your property, you can call like this:
    'debug.print Envinron$("USERNAME")

End Sub
It sounds like you'll be looking for this one:

msgbox Environ$("HOMESHARE")
Avatar of kcleary
kcleary

ASKER

Works good for an Windows NT computer, but what about for a 9X computer?
Hmm, Environ does work on 95.  Unfortunatly, the only 95/98 machines I have around right now are not on our network.  I'm curious, what did you get when you tried it?
Avatar of kcleary

ASKER

I'm using the FILE_SERVER variable/property (I didn't see a HOMESHARE one).  On a Win98 PC, there is no variable for FILE_SERVER, so I'm receiving nothing.
Avatar of kcleary

ASKER

I'm using the FILE_SERVER variable/property (I didn't see a HOMESHARE one).  On a Win98 PC, there is no variable for FILE_SERVER, so I'm receiving nothing.
For Novell:
Unless you have:
* a standardized login script that sets an environment variable to what you want, or
* a standard drive letter mapping whose properties you can query, then

it will be a real pain to find out what you want.

Much depends on which version of Novell you're running and whether or not you permit multiple connections.  With bindery connections, things are a little easier, but when logging into NDS, the concept of a login server begins to blur, since you don't neccessarily know before hand which physical server you'll be authenticated through.
Avatar of Ryan Chong
Hi kcleary,

Take a look on link below, maybe you can find something useful:

http://www.mvps.org/vbnet/code/network/index.html

'Hope will help.
Avatar of kcleary

ASKER

It appears that there's no way to get the info I need all of the time.  Environ$ works on an NT 4.0 PC, but I haven't been able to get it to work elsewhere.  ryancys link has plenty of good code, but nothing that looked like it would take care of the problem.  I beginning to fear that cookre is right.

I will continue to look at some of your comments and hopefully find a solution.
ASKER CERTIFIED SOLUTION
Avatar of cookre
cookre
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kcleary

ASKER

Thanks to everyone for the help on this question.  It seems there's no easy way to get the information that we need, but you all gave me some valuable info to help solve our problem.

I have submitted a request to split pts. between everyone.

Thanks again for the help.
Helll all, a Points slplit has been requested and will go as follows:

75=cookre
75=falkor
50=ryancys

I have refunded 125 point for the split.  I will accept 75 here for cookre.

kcleary, wyou will need to open 2 New questions, one for falkor and one for ryancys.

Entitle each question (IN THIS TOPIC AREA) *Points for <Expert Name>*    In the comment box type *for your help in question #20171853*  Choose the points you wish to aware 1=75 and 1=50 and submit, and you are all done.

Thanks,
ComTech
Communtiy Support