How to DIRECTLY execute command in txt file in cmd?

batch-file, cmd, command

Solution

cmd < command.txt

Of course it depends of the real content of command.txt.

Problem

I have a question. How can I execute command in a plain text file? I know it seems crazy and I can simply rename it as a .bat file BUT it is important for me. Without renaming it, can i execute it in CMD? I know I can simply do this : ``` ren command.txt command.bat & call command.bat & ren command.bat command.txt ``` But this is too inconvenient. Any simpler way?

Original source

Related problems