title: Command Prompt: Execute Commands from Any Text File (Not Having ".bat" or ".cmd" Extensions)
body: <p>I can't find any way to do, for example, the following:</p>
  
  <p><code>cmd.exe /C "script.txt"</code></p>
  
  <p>In other words, I need Command Prompt to (try) to execute file with any extension (not necessarily <code>.bat</code> or <code>.cmd</code>) if it contains valid batch script code. I'm looking for behavior similar to Unix shells:</p>
  
  <p><code>./script.txt</code></p>
  
  <p>While on Unix the <em>shebang</em> (<code>#!/bin/sh</code>) is responsible for understanding that the file is actually a script, it seems like on Windows <code>.bat</code> or <code>.cmd</code> extensions play the same role, indicating a batch script file for Command Prompt. </p>
  
  <p>Is it possible to avoid that and force Command Prompt to interpret a file with any name?</p>
  
  <p><strong>NOTE:</strong> Please, no answers like:</p>
  
  <blockquote>
    <p>Give your file <code>.bat</code> or <code>.cmd</code> extension.</p>
  </blockquote>
  
  <p>That's not what the question is about.</p>