>>>Anybody know a reliable way to determine if a workstation is connected to a network?
>>>
>>
>>Lots of ways; but it depends on what exactly you're trying to determine - for example, are you trying to see if the station is currently logged into any network, or a particular network, or if a particular network resource has been (or can be) attached, or if the station -can- log into a network (IOW if the necessary client software is present to operate on a network, even if not logged in presently), or something else?
>
>
>What I'm doing is creating a utility that shows files in use on a workstation or server. If the user is connected to a network, I want to show available servers, just like network neighborhood does. If not, I want to show the computer name.
>
>I'm thinking that I can use WNetEnumResource and if it returns an error code, assume that I'm not connected and show the computer name. If it doesn't, show the servers.
>
You might want to take a look at the Shell Automation object Shell.Application, using the BrowseForFolder() method, which can retrieve the names of computers anchored from the Network Neightborhood, and the Windows Scipting Host AUtomation object Wscript.Network