如何从 Windows XP 批处理文件设置处理器关联?

发布于 2024-07-18 05:00:14 字数 353 浏览 10 评论 0原文

我有一台双处理器机器,我想通过两个处理器上的批处理文件启动可执行文件。

例如: (1) 在处理器 1 上启动 Notepad.exe,并且 (2) 同时,处理器 2 上的 Notepad.exe

目前,我在批处理文件中使用以下内容,因为我的可执行文件“难以”启动并且需要返回才能在启动时运行: echo.|DoStuff.exe

因此,我想启动它并让它在每个处理器上运行。

感谢您提供的任何反馈。

PS 我认为“开始”对我不起作用,因为我需要将返回字符发送到可执行文件,如上所示,并带有 echo。

PSS 这是针对 Windows XP 解决方案。 谢谢。

I've got a dual processor machine and I would like to launch an executable via a batch file on both processors.

For example:
(1) Launch Notepad.exe on Processor 1, and
(2) Simultaneously, Notepad.exe on Processor 2

Currently, I'm using the following in my batch file, since my executable was "difficult" to launch and needed a return in order to run when launched:
echo.|DoStuff.exe

Thus, I would like to launch it and have it run on each processor.

Thanks for any feedback provided.

P.S. I don't think "start" will work for me since I need to send in the return character to the executable as shown above with echo.

P.S.S. This is for a Windows XP solution. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

拥醉 2024-07-25 05:00:14

start /affinity 1 notepad.exe

start /affinity 2 notepad.exe

(Windows7 对启动命令有亲和力,但 XP 没有。PSexec 可以用)

start /affinity 1 notepad.exe

start /affinity 2 notepad.exe

(Windows7 has affinity for the start command, but XP does not. PSexec works though)

陌上青苔 2024-07-25 05:00:14

Microsoft Sysinternal 的 psexec 的 -a 标志可以在 Windows XP 上设置处理器关联:

Usage: psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l][-s|-e][-x][-i
[session]][-c [-f|-v]][-w directory][-d][-][-a n,n,...] cmd [arguments]
     -a         Separate processors on which the application can run with
                commas where 1 is the lowest numbered CPU. For example,
                to run the application on CPU 2 and CPU 4, enter:
                "-a 2,4"

例如:

psexec -a 2 cmd /c "echo.|DoStuff.exe"

Microsoft's Sysinternal's psexec's -a flag can set processor affinity on Windows XP:

Usage: psexec [\\computer[,computer2[,...] | @file][-u user [-p psswd]][-n s][-l][-s|-e][-x][-i
[session]][-c [-f|-v]][-w directory][-d][-][-a n,n,...] cmd [arguments]
     -a         Separate processors on which the application can run with
                commas where 1 is the lowest numbered CPU. For example,
                to run the application on CPU 2 and CPU 4, enter:
                "-a 2,4"

For example:

psexec -a 2 cmd /c "echo.|DoStuff.exe"
冬天旳寂寞 2024-07-25 05:00:14
  • 此页面谈论免费
    称为 XCPU 的工具,您可以使用
    启动并设置亲和力。 但是,那
    里面的链接不起作用。 也许有一点
    谷歌搜索可以为您找到它。

  • 还有一个类似的工具
    这里称为runfirst。

  • This page talks about a free
    tool called XCPU you can use to
    launch and set affinity. However the
    link within doesn't work. Maybe a bit
    of googling can locate it for you.

  • And there is a simmillar tools
    here called runfirst.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文