Created
June 20, 2011 08:03
-
-
Save xnrghzjh/1035276 to your computer and use it in GitHub Desktop.
Excelプロセスを強制終了(wsfから移植)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Excel.exeが残ってしまった時用 | |
*/ | |
import org.codehaus.groovy.scriptom.* | |
def name = "EXCEL.EXE" | |
Scriptom.inApartment | |
{ | |
axo = new ActiveXObject("WbemScripting.SWbemLocator"); | |
list = axo.ConnectServer().ExecQuery("select * from Win32_Process where Name='${name}'") | |
list.each() { it.terminate } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment