title: How to connect Cortana commands to custom scripts?
body: <p>This may be a little early to ask this, but I'm running Windows 10 Technical Preview Build 10122. I'd like to set up Cortana to have custom commands. Here's how she works:</p>
  
  <pre><code>Hey Cortana, &lt;she'll listen and process this command&gt;
  </code></pre>
  
  <p>Microsoft will process the command and if there isn't anything for it, she'll just search the input on bing. However, I'd like to be able to say something like, just for example </p>
  
  <pre><code>Hey Cortana, I'm going to bed now
  </code></pre>
  
  <p>And have the input <code>I'm going to bed now</code> trigger run a batch script, a VBScript, a command, or any some sort some of custom response that basically does the following.</p>
  
  <pre><code>C:\&gt; shutdown -s
  </code></pre>
  
  <p>Is there a way to set up a predefined custom commands for Cortana?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I created this <a href="https://youtu.be/GICF03UAOcQ" rel="noreferrer"><strong>basic YouTube tutorial</strong></a> and <a href="https://youtu.be/GICF03UAOcQ" rel="noreferrer"><strong>this more advanced one</strong></a> with a corresponding <a href="https://github.com/crclayton/custom-cortana-commands-template" rel="noreferrer"><strong>GitHub repo</strong></a> based on talkitbr's excellent and very helpful answer <a href="https://stackoverflow.com/a/31387719/2374028">below</a>. </p>
  
  <p>At first his answer was beyond my understanding so I decided to break it down in a bit more detail for future users like myself.</p>