设为首页收藏本站淘宝杂货铺

从F到0 - From F to 0

 找回密码
 注册已关闭
搜索
查看: 2768|回复: 1
收起左侧

[批处理源码开源] 批处理实现设置进程优先级

[复制链接]
发表于 2020-4-23 21:09:12 | 显示全部楼层 |阅读模式
1.png

  1. @echo off
  2. title 设置进程优先级
  3. mode con cols=25 lines=9

  4. :b
  5. set /p a=进程名:
  6. if "%a%" == "" goto b
  7. :a
  8. set /p b=优先级(0:低 1:低于标准 2:普通 3:高于标准 4:高 5:实时):
  9. if "%b%" == "" goto a
  10. if %b% lss 0 goto a
  11. if %b% gtr 5 goto a

  12. if %b% == 0 set b="Idle"
  13. if %b% == 1 set b="Below Normal"
  14. if %b% == 2 set b="Normal"
  15. if %b% == 3 set b="Above Normal"
  16. if %b% == 4 set b="High Priority"
  17. if %b% == 5 set b="Realtime"

  18. wmic process where name='%a%' call SetPriority %b% >nul
  19. pause
复制代码

相关帖子

您需要登录后才可以回帖 登录 | 注册已关闭

本版积分规则

QQ|手机版|Archiver|从F到0 ( 蒙ICP备17002595号-1 )
蒙公网安备15010402000325号

腾讯云安全认证

GMT+8, 2024-3-29 22:50 , Processed in 0.501029 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表