如何直接在cmd中的txt文件中执行命令?

Jam*_*mie 3 command cmd batch-file

我有个问题.

如何在纯文本文件中执行命令?

我知道这看起来很疯狂,我可以简单地将其重命名为.bat文件,但这对我来说很重要.
如果不重命名,我可以在CMD中执行吗?

我知道我可以这样做:

ren command.txt command.bat & call command.bat & ren command.bat command.txt
Run Code Online (Sandbox Code Playgroud)

但这太不方便了.有更简单的方法吗?

MC *_* ND 5

cmd < command.txt
Run Code Online (Sandbox Code Playgroud)

当然这取决于command.txt的实际内容.