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