How to run custom commands with Cortana

Reading time icon 2 min. read

Readers help support MSPoweruser. When you make a purchase using links on our site, we may earn an affiliate commission. Tooltip Icon

Read the affiliate disclosure page to find out how can you help MSPoweruser effortlessly and without spending any money. Read more

Microsoft’s Cortana is built with a large number of commands in the Windows 10 app. With the Windows 10 Spring Creators Update, you’ll be able to do even more with Cortana, and it’ll be a springboard for timeline and activities.
Sometimes, however, Cortana doesn’t do just what you want it to do. Perhaps Microsoft hasn’t thought about implementing that command, or they don’t want to for their own reasons.

There’s a feature in Cortana that you can use to create new commands, and this relies on taking advantage of its “open file” command. in essence, if you create a new command file with Windows, and you name it something command-like, you can ask Cortana to open the file, which triggers the command, in essence triggering a custom command via Cortana

TL: DR; You’ll be using Cortana’s abilities to open a script or a command that executes a process not native to Cortana.

How to create custom commands for Cortana

  1. Use the Windows + R shortcut, or right click on the start menu and select “Run” to open the run command box
    Enter the following:: C:\Users\USERNAMEGOESHERE\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
  2. Right-click on an empty area, select New and click on Shortcut.
  3. When you see the “Type the location of the item” field, use this to enter the command you want Windows to execute. Perhaps you want to restart your computer, then entering the following command would help:shutdown.exe -rCreating a command on windows 10
  4. Name the command shortcut whatever you want, preferably something that you can pronounce so you can issue it as a command. “Hey Cortana, Open ‘Restart My PC’ for instance. Of course, check that Cortana does not have an active command for that phrase already prior to naming your shortcut.
  5. Once done, using Cortana to open the command file should initiate a restart, or whatever you put in place of that.
    Tip: There are a few more ways you can customise your commands, have a look here for various other modifications to the shutdown command.

More about the topics: Command, Cortana, how to, windows 10