是否可以通过命令行标记 Windows 进程的描述?
想象一下我想在 Windows 命令行中运行一个名为 Foo.exe 的程序。当我查看“任务管理器 ->”时,有没有办法标记该进程“描述”字段?流程?顺便说一句,该 exe 不是我的/我无法编译它。
imagine i want to run a program called Foo.exe
in the Windows command line. Is there a way I can tag that process 'Description' field, when I look in the Task Manager -> Processes
? BTW, the exe isn't mine / i can't compile it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
任务管理器显示的描述字段是从可执行文件的版本资源中读取的。因此,当您开始该过程时,您无法更改它(标记它)。如果您想影响那里出现的内容,那么您需要修改可执行文件,我不认为这是您想要做的。
The description field that is displayed by the task manager is read from the version resource of the executable file. So you can't change it (tag it) when you start the process. If you want to influence what appears there then you need to modify the executable which I don't believe is what you are looking to do.
查看 SetConsoleTitle API 。这将允许您设置包含控制台的窗口的标题。这是显示在任务管理器->应用程序中的字符串。它对任务管理器->进程没有帮助(正如 David Heffernan 提到的,它来自版本资源并且是不可变的),但总比没有好。
Take a look at the SetConsoleTitle API. That will let you set the title of the window containing the console. This is the string which shows up in task manager->applications. It doesn't help with Task Manager->processes (as David Heffernan mentioned, that comes from the version resource and is immutable), but it's better than nothing.