关闭文件夹的用批处理文件窗口 [英] Close folder's window with batch file

查看:1023
本文介绍了关闭文件夹的用批处理文件窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的桌面命名的文件夹测试。我想,为了当该文件夹被打开与Windows资源管理器自动关闭窗口,以创建一个批处理文件。我试了下命令,但没有发生在执行

I have a folder on my Desktop named test. I want to create a batch file in order to close the window automatically when this folder is opened with Windows Explorer. I tried the next command, but nothing happened on execution of

TASKKILL /F /FI "WINDOWTITLE eq test" /IM explorer.exe

这显示的信息是

No tasks running with the specified criteria.

任何帮助吗?

推荐答案

这是不可能关闭使用命令文件夹的Windows资源管理器窗口 TASKKILL 如果在Windows注册表在

It is not possible to close the Windows Explorer window of a folder using command taskkill if in Windows registry under

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

双字 SeparateProcess 值为 0 分别选择的打开文件夹窗口中一个单独的进程的关于查看 文件夹选项 是标签不进行检查。

the double word SeparateProcess has the value 0 respectively option Launch folder windows in a separate process on View tab of the Folder Options is not checked.

和作为 foxidrive 发现(阅读下面的意见),我还可以确认,启用此设置对Windows XP中SP3上的的Explorer.exe 的甚至是Windows重新启动后打开文件夹运行的数量没有影响。

And as foxidrive found out (read comments below) and I can also confirm, enabling this setting has on Windows XP SP3 no effect on number of explorer.exe running on opening folders even after a restart of Windows.

因此​​它依赖于Windows(2000,XP,Vista中,7,8,8.1)的版本,并在文件夹选项

Therefore it depends on version of Windows (2000, XP, Vista, 7, 8, 8.1) and the Folder Options


  • 显示在标题栏中完整的路径

  • 在一个单独的进程打开文件夹窗口

  • Display the full path in the title bar
  • Launch folder windows in a separate process

如果有可能在所有使用命令 TASKKILL 来关闭一个资源管理器文件夹窗口和字符串中的标题栏中找到,文件夹或只是名称该文件夹的完整路径。

if it is possible at all to use the command taskkill to close an Explorer folder window and which string to find in title bar, just the name of the folder or the full path of the folder.

在Windows XP或带有的在一个单独的进程打开文件夹窗口的未启用该文件夹窗口没有打开分别作为单独的任务,因为独立的进程。

On Windows XP or with Launch folder windows in a separate process not being enabled the folder window is not opened as separate task respectively as separate process.

有多少文件夹窗口打开独立,的Explorer.exe 过程中每个用户的数量永远只是1.每个文件夹窗口中的实际只是一个窗口始终运行Windows资源管理器(桌面)在单独的线程中打开。 Windows资源管理器只需pretends该文件夹窗口是Windows任务栏上的一个单独的任务和的应用程序的Windows任务管理器选项卡。但只有一个的Explorer.exe 终止上市的进程的Windows任务管理器,即使打开了多个文件夹窗口选项卡。

Independent on how many folder windows are opened, the number of explorer.exe processes for each user is always just 1. Every folder window is in real just a window of always running Windows Explorer (desktop) opened in a separate thread. Windows Explorer just pretends that the folder window is a separate task on Windows task bar and on Applications tab of the Windows task manager. But only one explorer.exe is listed on Processes tab of Windows task manager even with multiple folder windows opened.

Windows资源管理器的这种行为可以用的的Process Explorer 能更好地观看= nofollow的>选择的Sysinternals公司的的Explorer.exe 的和查看在下面的窗格上很多其他的手柄也已打开的手柄中含有这一过程的手柄文件夹窗口。

This behavior of Windows Explorer can be better watched with free tool Process Explorer of Sysinternals by selecting explorer.exe and viewing in lower pane on the handles of this process containing among lots of other handles also the handles of the opened folder windows.

需要一个控制台应用程序,它通过标题找到一个窗口,得到这个窗口的句柄,并发送 WM_CLOSE 事件消息到这个文件夹窗口。例如,见

A console application is required which finds a window by title, get the handle of this window and sends the WM_CLOSE event message to this folder window. See for example

  • How to close Windows Explorer from CMD?
  • How do I keep Windows Explorer from interfering with deleting a folder?
  • How to close Windows Explorer windows with opened folders from a certain drive?

这篇关于关闭文件夹的用批处理文件窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆