Created
November 25, 2020 04:55
-
-
Save h-mochizuki/18d2fe527b18377e5ae54bb6d1972804 to your computer and use it in GitHub Desktop.
ダブルクリックすると、バッチのあるフォルダを閉じるバッチ
This file contains 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
@if(0)==(0) echo off | |
setlocal | |
call cscript //nologo /E:JScript "%~f0" %CD:\=/% | |
exit /b | |
@end | |
var folder = "file:///" + WScript.Arguments(0); | |
var shellWindows = (new ActiveXObject("Shell.Application")).Windows(); | |
if (shellWindows != null) { | |
for (var win = new Enumerator(shellWindows); !win.atEnd(); win.moveNext()) { | |
if (folder == win.item().LocationUrl) win.item().Quit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
バッチをクリックした後でエクスプローラが開いていることによる問題(リネームや削除ができない等)を解消するために使用します。