Advertisement
Guest User

Untitled

a guest
Jul 10th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. Public Sub Test()
  2. Dim PuttyPID as Long, username as String, password as String
  3. username= " xxxxxx": Password= "123456"
  4. P1 = "C:Program Files (x86)PuTTyputty.exe - ssh" & username & _
  5. "@xx.yyy.zzz.aaa - pw" & Password
  6. PuttyPID = Shell(P1, 1)
  7.  
  8. '''''''''''''''''''''''''''''''''''''''''''
  9. Application.Wait Now + TimeSerial(0, 0, 20) ' <-- give it time to get server prompt
  10. AppActivate PuttyPID ' <-- activate it again to make sure
  11. SendKeys "cd /folder1/folder2" & vbCr ' <-- vbCR to simulate CR key
  12. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement