Launcher check server and server shares during launch process

Movian

New member
Joined
Nov 19, 2012
Messages
3
Programming Experience
5-10
Hey,
I have a launcher that checks for updates for an application I maintain. I am trying to update the launcher to check for a few things during the launch process to provide meaningful information to users to reduce calls for some specifics issues.

I have implemented a ping check for the server to make sure that the local machine can ping the server and if not it will notify the user that it is not able to see the server and that they may need to resolve a network issue before the application will work correctly.

VB.NET:
'Get servername from registry if available.        
Dim ServerLoc As String
Dim ErrorString As String = "Unable to connect to server, please check your network connection; that the server is turned on, and that you have authenticated with the server using your windows login. The application may not connect until this network problem is corrected."

ServerLoc = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\VB and VBA Program Settings\SonoSoft\Connection", "ConLoc", Nothing)

If Not IsNothing(ServerLoc) Then
    Dim array As String() = ServerLoc.Split("\")
    Try
        If Not My.Computer.Network.Ping(array(0)) Then
            MsgBox(ErrorString , MsgBoxStyle.Critical)
        End If
    Catch ex As Exception
         MsgBox(ErrorString , MsgBoxStyle.Critical)
    End Try
Else
    MsgBox("Unable to locate server name you may be prompted to enter connection information when the application launches.")
End If

What I am looking for now is to check if a specific share is available on the same server, an issue we sometimes come across is that the server requires windows authentication from the user. (Eg. if I go to start->Run and do \\server\share windows will prompt for a login).

Is there a way to check if this login is required? if not it would do nothing but if it IS required I could do something like shell the path to explorer.exe so the user can enter the credentials before continuing with the launch process (This authentication also seems to stop the application connecting to the SQL database which is important for the application).

Any help on this is apriciated! :)
 
Last edited:

Latest posts

Back
Top