MightySW
asked on
How to close correct window with this VBS
Hi guys, just wondering how to script this correctly to wait for the window to run the secureCRT application and THEN close the window. Right now it is closing the first window that is open. If I run this from explorer or from cscript from dos it will close those windows and then run secureCRT.
Please help
Thanks
Please help
Thanks
Dim objShell
Set objShell = Wscript.CreateObject("Wscript.Shell")
objShell.run(Chr(34) & "C:\Program Files\VanDyke Software\SecureCRT\SecureCRT.EXE" & chr(34) & " /script D:\logs\Scripts\recordedScript.vbs")
objShell.AppActivate "192.168.1.79 - SecureCRT"
objshell.SendKeys "%{F4}"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the reply. I tried the loop (exactly how you have it) and everything opens fine, but secureCRT still will not close. At least nothing closed now. Seems that the boolean is either set too soon, or success lost its value.
ASKER
I'll try it.
ASKER
From one MASTA TO ANOTHAHHH
Thanks bro, that did it!
Where did you find that dang command? I even looked at the script manual for SecureCRT.
Thanks bro, that did it!
Where did you find that dang command? I even looked at the script manual for SecureCRT.
ASKER
Thanks, I left a follow up question.
Can you just post the link.
Thanks again. See you on the forums.
Can you just post the link.
Thanks again. See you on the forums.
ASKER
ASKER
Just FYI and for anybody else that runs into this issue
Do this:
crt.Screen.Synchronous = False
before
crt.quit or else it will not write anything before disconnecting.
Do this:
crt.Screen.Synchronous = False
before
crt.quit or else it will not write anything before disconnecting.
I think it was this one:
http://forums.vandyke.com/showthread.php?t=1204
I also just ran across this one that looks useful:
https://www.vandyke.com/support/tips/scripting/creating.html
The more Im reading about this prog, the more I think I want to give it a try. Could be mighty useful with all the cisco equipment I have to manage. Thanks for the tip :D
http://forums.vandyke.com/showthread.php?t=1204
I also just ran across this one that looks useful:
https://www.vandyke.com/support/tips/scripting/creating.html
The more Im reading about this prog, the more I think I want to give it a try. Could be mighty useful with all the cisco equipment I have to manage. Thanks for the tip :D
ASKER
yeah, SecureCRT is by far the best when dealing with Cisco equipment. It was recommended to me by a CCIE a long time ago and is still the preferred program for Cisco equipment. Very versatile and cheap.
Thanks again for your help. It is running well now.
Thanks again for your help. It is running well now.
Let me know how it works.
Open in new window