试试这样,这样是只要打开的文件夹路径包含 bbs.ssh.bank 就会关闭- ' 2>nul&cls&@echo off
- ' 2>nul&for /f "tokens=1* delims=/" %%a in ('cscript -nologo -e:vbscript "%~f0"^|find "bbs.ssh.bank"') do set a=%%~nxb
- ' 2>nul&mshta vbscript:execute("For Each w In CreateObject(""Shell.Application"").Windows:If w.LocationName=""%a%"" Then:w.Quit:End If:Next")(close)
- ' 2>nul&pause
- ' 2>nul&exit
-
- Dim arrURL(), strURL, oShell, oWin, n
- n = -1
- Set oShell = CreateObject("Shell.Application")
- For Each oWin In oShell.Windows
- If Instr(1, oWin.FullName, "\explorer.exe", vbTextCompare) Then
- n = n + 1
- ReDim Preserve arrURL(n)
- arrURL(n) = oWin.LocationURL
- End If
- Next
- For Each strURL In arrURL
- wscript.echo strURL
- Next
复制代码
|