寻找一种方式来一次击中夹10个文件执行批处理文件 [英] Looking for a way to execute a batch file once a folder hits 10 files

查看:230
本文介绍了寻找一种方式来一次击中夹10个文件执行批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一种方式来监视文件夹,以便执行一个批处理文件,一旦它击中10个文件。如果使用VBScript或任何其他类型的这样的解决方案,这将是很酷的。

I am looking for a way to monitor a folder so that it executes a batch file once it hits 10 files. It would be cool if it used vbscript or any other type of solution like that.

任何帮助,将AP preciated

any help would be appreciated

感谢

推荐答案

请参考这个问题:<一href=\"http://stackoverflow.com/questions/4230976/batch-file-to-monitor-additions-to-download-folder/4231025\">batch文件监视增补下载文件夹

请注意<一个href=\"http://stackoverflow.com/questions/4230976/batch-file-to-monitor-additions-to-download-folder/4248647#4248647\">Nick's最终的解决方案,他计算的文件。

Note Nick's final solution where he counts files.

我会建议任何像这样的测试是通过任务计划程序执行。

I would recommend that any test like this is executed via Task Scheduler.

rem Counting files...
set /a count = 0
for /f "tokens=*" %%P IN ('dir "C:\examplefolder" /A /b') do (set /a count += 1)

rem 10 or more files?
if %count% GEQ 10 call AnotherBatchFileHere.bat

这篇关于寻找一种方式来一次击中夹10个文件执行批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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