i honestly can't tellthe difference between the SysWOW64\cmd.exe and System32\cmd.exe...Anyway here is the code i am using:
Dim data As Range
Dim voi As Range
' The variables data & voi contains the cells that will
' cause an alert when they are right clicked.
Set data = Range("J2:J25,V2:V25,AG2:AG25")
If Not Application.Intersect(data, Range(Target.Address)) _
Is Nothing Then
t = Shell("cmd.exe", vbNormalFocus)
Application.Wait Time + TimeSerial(0, 0, 2)
SendKeys "telnet 10.220.44."
SendKeys Range((Target.Address)).Offset(0, -1)
SendKeys "{ENTER}"
Application.Wait Time + TimeSerial(0, 0, 2)
SendKeys "user1{ENTER}"
SendKeys ("PASS11")
Application.Wait Time + TimeSerial(0, 0, 1)
SendKeys "conf t{ENTER}int fa0/"
SendKeys Range((Target.Address)).Offset(0, -2)
SendKeys "{ENTER}"
SendKeys "sw acc vl "
SendKeys Target.Value
SendKeys "{ENTER}sh{ENTER}no sh{ENTER}"
SendKeys "end{ENTER}wr{ENTER}exit"
Application.Wait Time + TimeSerial(0, 0, 1)
SendKeys "{NUMLOCK}", True
MsgBox "DONE"
End If
End Sub
edit:> see attachment.
Bookmarks