Kill explorer.exe with windows title
I'm new with programing and my question is now, how i can close some specific explorer.exe windows. My Problem is, i have a program that call some windows:
Option Explicit
Dim shell, expl1, expl2, expl3, Terminate
Dim uprgExplorer
set shell = WScript.CreateObject("WScript.Shell")
set expl1 = shell.exec("C:\WINDOWS\explorer.exe c:\Documents and Settings")
set expl2 = shell.e开发者_开发问答xec("C:\WINDOWS\explorer.exe C:\WINDOWS\system32\CCM\Cache")
set expl3 = shell.exec("C:\WINDOWS\explorer.exe c:\SCRIPTS\LOG")
Now i will kill only this 3 windows NOT the explorer.exe.
Can some one help me?
Greetings,
matthias
You could use the SendKeys
function to close the Explorer windows:
set shell = WScript.CreateObject("WScript.Shell")
set expl1 = shell.exec("C:\WINDOWS\explorer.exe c:\tmp")
MsgBox "Explorer started."
success = shell.appactivate("c:\tmp")
if success then shell.sendkeys "%{F4}"
You might also want to have a look at AutoHotkey, which allows you to record macros and manipulate windows.
精彩评论