How can I close a window with a specific title in Windows XP base using VBscript?
Or is there another way to solve this problem?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the
SendKeysmethod to send the Alt+F4 shortcut to the window you wish to close. This window must be active at the moment, so you also need to callAppActivateright beforeSendKeys.Basically, you’ll need something like this:
You may want to add checks and small delays to make your script more foolproof:
Edit: (An answer to your comment/question about VBScript resources.)
I’ve compiled some links to VBScript websites and resource pages that I hope they will be helpful:
Learning
References
Other resources
As for VBScript resources in Russian, check out script-coding.info and Серый форум — there’re lots of useful and interesting examples. Also, take a look at the this thread, which contains links to many VBScript resources, including those in Russian.