Cortana on Windows 10 is your personal assistant that may help you to carry on your daily tasks, answer the questions and permits you to use voice commands for getting things done hands-free.
Although the assistant can be handy, its limited to tasks it can perform. For instance, It is possible to use voice commands for executing many power options, but there is not a command to put your PC to sleep mode. You can although use commands for opening up a specific section in the Settings app, Cortana doesn’t can change a specific setting on its own.
It is possible to use Cortana’s Open command for running a shortcut linked to a specific command that permits you to perform any task using only your voice.
How to execute custom commands with the use of Cortana?
Go through these steps for creating a shortcut that executes a particular command, and you will learn steps to perform more complex task running a script.
Executing a command
- Press the Windows key + R keyboard shortcut for opening the Run command.
- Click the command and hit OK.
- C:\Users\Your UserName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs.
- Click Right on an empty area, Choose New and click on the Shortcut.
- In the field named “Type the location of the item,” Hit the command you want to execute.
- Now Click Next.
- Type descriptive name for short that will also be the voice command which will permit Cortana to run the task. For instance, Hibernate Device.
- Hit Finish now.
Once you are done with these steps, you can use “Hey Cortana, Open Hibernate Device” voice command for hibernating your computer.
Running a script
In the example below, you will create a command to execute a script with the use of Cortana to switch from Light to dark theme with the use of a voice command.
- Open-File Explorer with the help of Windows key+E.
- Browse into the folder you want to store script.
- Click right on an empty area, Choose New and Hit on New Text Document.
- Type name for the file, be sure to change its file extension from .txt to .bat and hit Enter.
- Click Right the .bat file and choose Edit.
- Copy and paste the respective command into a batch file.
- Save file normally with the help of Ctrl+S.
- Click Right on the file, choose to Create Shortcut.
- Choose shortcut, hit F2, remove .bat- Shortcut as part of the name and hit Enter.
- Right, Click the shortcut and select Cut.
- Use Windows key+ R keyboard to open Run command.
- Type the following path and hit OK.
- C:\Users\Your Username\Appdata\Roaming\microsoft\Windows\Start Menu\Programs.
- Click right on a void space and select paste.