替换exe资源文件_可以始终用COM替换EXE文件扩展名吗?

替换exe资源文件

替换exe资源文件

can-exe-file-extensions-always-be-replaced-with-com-ones-00

If you have ever heard of changing a file’s extension from EXE to COM, you may have wondered if it was only capable of working on a few rare files or if it would work on nearly any EXE file you have. Today’s SuperUser Q&A post has the answer to a curious reader’s question.

如果您曾经听说过将文件扩展名从EXE更改为COM,您可能想知道它是否只能处理少数几个稀有文件,或者是否可以处理您拥有的几乎所有EXE文件。 今天的“超级用户问答”帖子回答了一个好奇的读者的问题。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

问题 (The Question)

SuperUser reader Royi Namir wants to know if EXE file extensions can always be replaced with COM ones?:

超级用户阅读器Royi Namir想知道EXE文件扩展名是否总是可以用COM替换?

Our antivirus software refused to let me copy an EXE file into my Windows 7 startup folder (calc.exe, for example) since it is an EXE file. I then changed the file extension from EXE to COM on the file and was able to easily copy it into the folder without problems (very professional).

我们的防病毒软件拒绝我将EXE文件复制到Windows 7启动文件夹(例如,calc.exe)中,因为它是EXE文件。 然后,我将文件扩展名从EXE更改为COM,并且能够轻松地将其复制到文件夹中(非常专业)。

And of course, calc.com works just as well as calc.exe, which got me to wondering. When will a program with an EXE file extension not work when the extension is changed to COM? Almost every EXE file that I have checked has worked. I would love to know the reasons for the “why and why not” of the matter.

当然,calc.com和calc.exe一样好,这让我很纳闷。 将扩展名更改为COM时,带有EXE文件扩展名的程序什么时候不起作用? 我检查的几乎每个EXE文件都有效。 我很想知道问题“为什么和为什么不”的原因。

Can EXE file extensions always be replaced with COM ones?

可以将EXE文件扩展名始终替换为COM扩展名吗?

答案 (The Answer)

SuperUser contributor Math Man has the answer for us:

超级用户贡献者Math Man为我们提供了答案:

It has to do with the internal format of the file. Originally, COM files were simple memory images and EXE files had lots of headers associated with them. As a result, you could not rename them.

它与文件的内部格式有关。 最初,COM文件是简单的内存映像,而EXE文件具有许多与之关联的标头。 结果,您无法重命名它们。

As time went on and they had to make things backward compatible, Microsoft changed it so that the operating system looks at the file itself to determine what type of file it is instead of the extension. As a result, when you run the renamed file, Windows ignores the extension entirely.

随着时间的流逝,他们不得不使它们向后兼容,Microsoft对其进行了更改,以便操作系统查看文件本身来确定文件类型,而不是扩展名。 因此,当您运行重命名的文件时,Windows将完全忽略扩展名。

Visit the links below for a more detailed and extensive explanation.

请访问下面的链接以获取更详细和广泛的说明。

What is the Difference Between .com, .exe, and .bat? [StackOverflow]

.com,.exe和.bat有什么区别? [堆栈溢出]

What’s the difference between the COM and EXE extensions? [Microsoft Developer Blog]

COM和EXE扩展名有什么区别? [Microsoft开发人员博客]



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/267397/can-exe-file-extensions-always-be-replaced-with-com/

替换exe资源文件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值