Consulting

Results 1 to 2 of 2

Thread: Check if Plink.exe is active

  1. #1
    VBAX Mentor paulked's Avatar
    Joined
    Apr 2006
    Posts
    394
    Location

    Check if Plink.exe is active

    Hi

    I use Plink to make a secure shell connection to our website to enable me to access our database.

    Sub PlinkConnect()
        Dim Prog As String, Arg As String
        Prog = "C:\Program Files\Putty\plink.exe"
        Arg = " -ssh Fringe -pw *********"
        Call Shell(Prog & Arg, vbMinimizedFocus)
        Application.Wait (Now + TimeValue("00:00:05"))
        SendKeys "{ENTER}", True
    End Sub
    How can I detect if the tunnel is open so I don't have more than one connection at a time?
    Semper in excretia sumus; solum profundum variat.

  2. #2
    VBAX Mentor paulked's Avatar
    Joined
    Apr 2006
    Posts
    394
    Location
    I couldn't find out how to detect if the database is connected, so I have to check if Plink is running with

        Dim objList As Object
        Set objList = GetObject("winmgmts:").ExecQuery("select * from win32_process where name='plink.exe'")
        If objList.Count > 0 Then Exit Sub
    and hope it's connected!
    Semper in excretia sumus; solum profundum variat.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •