Nie*_*ley 1 cpu explorer command-line cmd batch-file
您好,我已经看到了几个这样的问题,但当我尝试遵循这些说明时,感觉我错过了一些东西
>
创建一个 .bat 文件来运行该程序,使用超时命令等待几秒钟让辅助进程运行,然后使用以下命令将辅助进程优先级更改为您想要的。
wmic process where name="进程名称" CALL setpriority "value"
可能的值:“空闲”、“低”、“低于正常”、“正常”、“高于正常”、>“高优先级”、“实时”
我制作了一个包含这些行的批处理文件:
start "C:\Program Files (x86)\Origin Games\STAR WARS Battlefront\starwarsbattlefront.exe"
timeout /t 60 /nobreak
wmic process where name="starwarsbattlefront.exe" CALL setpriority "above normal"
Run Code Online (Sandbox Code Playgroud)
当我运行这个时,我收到一个错误。我读过 StackoverFlow 和 SuperUser 上的很多关于这方面的文章,但没有一篇文章清楚地说明了最终产品。抱歉,我看起来很无知(因为我就是),我觉得我错过了一些明显的东西。谁能帮我解决这个问题吗?
提前致谢 :)
编辑 *
错误是:“C”不被识别为内部或外部命令、可操作程序或批处理文件。
::Launches Star Wars Battlefront and sets priority to "above normal"
@echo off
START /ABOVENORMAL /D "C:\Program Files (x86)\Origin Games\STAR WARS Battlefront\" "" "starwarsbattlefront.exe"
timeout /t 60 /nobreak
wmic process where name="starwarsbattlefront.exe" CALL setpriority "above normal"
echo Done.
TIMEOUT 10
exit
Run Code Online (Sandbox Code Playgroud)
更好的命令来启动应用程序。有了这个,你就不会有任何问题了:]。“/D”基本上是“来自目录”。以 :: 开头的行只是一个注释。执行 .bat 文件时您将看不到它。结束部分仅显示文本“完成”。然后在关闭前从 5 倒数到 0。
/ABOVENORMAL 可能无法按预期工作,因为通过启动 .exe,您可能会提示 Origin 启动应用程序。那么优先级可能不适用于《星球大战:前线》。这就是我保留“wmic”部分的原因。但是它对于其他应用程序应该可以正常工作。
可能有更好更快的方法来做到这一点。
| 归档时间: |
|
| 查看次数: |
23475 次 |
| 最近记录: |