jaded Posted December 29, 2014 Posted December 29, 2014 Hi folks, I have the below script which is really testing my patience It opens a cmd console (Raven.Smuggler.exe), exports a database, connects to VPN, imports the database (again Raven.Smuggler.exe), disconnects from VPN - and the idea is that the WinWaitClose waits for the cmd windows to be closed. This works fine the first time (when exporting DB) and it doesn't continue the script till the window closes, but when the second cmd window opens (to import DB), it continues right away and disconnects from VPN. There is no window title on the command window other than "c:RavenDBSmugglerRaven.Smuggler.exe" , but i don't know if it counts as a title or just the path. I have tried using window title, class, instances etc, but nothing seems to work on the second window. I think it might have something to do with that the windows are alike? Hope you can help me Opt("WinTitleMatchMode", 2) ; Exports DB Run("c:\RavenDB\Smuggler\Raven.Smuggler.exe out http://server01:8080/databases/test-develop e:\testdir\") WinWaitClose("Smuggler") ; Run VPN Client Run("C:\Program Files (x86)\Cisco Systems\VPN Client\vpngui.exe") WinWaitActive("status: Disconnected | VPN Client") Sleep(500) ; Connects to VPN Server Send("{ENTER}") WinWaitActive("status: Connected | VPN Client") Sleep(500) ; Imports DB Run("c:\RavenDB\Smuggler\Raven.Smuggler.exe in http://server01:8080/databases/test-develop e:\testdir\") WinWaitClose("Smuggler") ; Closes VPN Client WinActivate("status: Connected | VPN Client") Sleep(1000) Send("!c") Sleep(1000) Send("{DOWN}{ENTER}") Sleep(5000) Send("!{F4}")
jguinch Posted December 29, 2014 Posted December 29, 2014 Maybe try with this : Opt("WinTitleMatchMode", 2) [...] WinWaitClose("Smuggler.exe") Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
jaded Posted December 29, 2014 Author Posted December 29, 2014 Thank you for the answer jguinch. Sadly it didn't help. When i try with "Smuggler.exe" it doesn't even wait for the first window to close before proceeding.
TheSaint Posted December 29, 2014 Posted December 29, 2014 Have you tried getting a handle for the first cmd window? And then tried the instance with that? Usually when I use cmd windows (DOS console) I use RunWait or perhaps ProcessWait etc. You can also try utilizing the pid. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)
jaded Posted December 29, 2014 Author Posted December 29, 2014 Thank you guys! ProcessWaitClose did the trick Didn't know that one. Happy holidays
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now