Windows命令行 - 在循环中将高优先级分配给FINDSTR [英] Windows Command Line- Assign High Priority to FINDSTR within a loop
本文介绍了Windows命令行 - 在循环中将高优先级分配给FINDSTR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
FORFILES / PC:有没有人知道如何操作这段代码, \path / M * / Ccmd / c FINDSTR / c:@ FILEC:\path\ *> C:\path\repgenresults.txt
我尝试在任务管理器中手动分配优先级,但我需要做几千次,因为每个新的进程与一个新的迭代循环被分配普通优先级。我也尝试结合cmd和启动函数没有太多的运气。任何想法?
解决方案
您可以将所有内容放在批处理文件中,然后使用命令START执行优先级选择的批处理文件
示例
STARTRunAsHighPriority/ HIGH / WAIT YourCommand.cmd
Does anybody know how to manipulate this code so that the FINDSTR process always is assigned high priority?
FORFILES /P C:\path /M * /C "cmd /c FINDSTR /c:"@FILE" C:\path\*">C:\path\repgenresults.txt
I tried assigning priority manually in Task Manager, but I would need to do that a couple thousand times, because each new process with a new iteration of the loop is assigned normal priority. I also tried combining the cmd and start functions without much luck. Any ideas?
解决方案
You could put everything inside a batch file then use the command START to execute the batch file with the priority choosen
Example
START "RunAsHighPriority" /HIGH /WAIT YourCommand.cmd
这篇关于Windows命令行 - 在循环中将高优先级分配给FINDSTR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文