Windows Command Line- Assign High Priority to FINDSTR within a loop

落花浮王杯 提交于 2019-12-25 05:00:45

问题


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?


回答1:


You could put everything inside a batch file then use the command START to execute the batch file with the priority choosen

See START references

Example

START "RunAsHighPriority" /HIGH /WAIT YourCommand.cmd 


来源:https://stackoverflow.com/questions/10761057/windows-command-line-assign-high-priority-to-findstr-within-a-loop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!