VBScript - Conditional window close
Hi Everyone,
I'd like to create a script to close a window if it pops up. Here is what I presently have, but it's not perfect. I want the window to close if it pops up, I'd prefer not to use the 'sleep; that's presently in the script.
--------------------------------
dim sh
set sh = createobject("wscript.shell")
if sh.appactivate("Microsoft Windows Messenger 5.1 5.1.0700 (English)") then
wscript.sleep 250
sh.sendkeys "%{f4}"
end if
set sh = nothing
---------------------------------
Thanks!
I'd like to create a script to close a window if it pops up. Here is what I presently have, but it's not perfect. I want the window to close if it pops up, I'd prefer not to use the 'sleep; that's presently in the script.
--------------------------------
dim sh
set sh = createobject("wscript.shell")
if sh.appactivate("Microsoft Windows Messenger 5.1 5.1.0700 (English)") then
wscript.sleep 250
sh.sendkeys "%{f4}"
end if
set sh = nothing
---------------------------------
Thanks!
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
andler
19 years ago
Posted by:
Paraleptropy
19 years ago
Posted by:
Byoung4now
19 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.