Extending the Functions of Windows 10’s Cortana


  1. Posts : 5
    Windows 10 64-bit
       #1

    Extending the Functions of Windows 10’s Cortana


    Cortana is quite capable, but there are times when I wish it has more features. For example, I really wanted to be able to lock my computer with a single voice command, but Cortana does not have this function built in. Fortunately, it is possible to extend Cortana's function. To do so, we make use of the fact that Cortana searches through the start menu shortcuts when you say the keyword "open" or "launch".

    Here are the steps to create a command to lock your computer:

    1. Create a shortcut in an accessible location such as the desktop. This can be achieved by pressing the right mouse button and select [New]->[Shortcut].
    2. For the location of the item, enter: %SystemRoot%\System32\rundll32.exe user32.dll,LockWorkStation
    3. Give the shortcut a natural name, which is what Cortana will look for when you speak to her. Since Cortana utilitizes natural language processing, it is much better at recognizing phrases that actually make sense.
    4. Copy the newly created shortcut to: %SystemDrive%\ProgramData\Microsoft\Windows\Start Menu\Programs. You will need administrative privileges to complete this step.

    If all goes well, you should be able to lock your computer by saying "hey Cortana, open lock computer".

    You can create similar commands to hibernate or sleep your computer. Just change the location of the item accordingly:

    • Hibernate: %SystemRoot%\System32\rundll32.exe Powrprof.dll,SetSuspendState Sleep
    • Sleep: You need PSTools from Microsoft. Set item location as: [Location of PSTools]\psshutdown.exe -d -t 0


    Another thing you can do is to create a command to open a website. You might think that this would be as simple as adding an internet shortcut to the start menu, but turns out it is more complicated than that: while Cortana keeps a record of internet shortcuts created through installation of programs, she does not do so with ones that are added manually. Furthermore, she does not index shortcuts that have non-executable extensions, meaning that you cannot use "chrome.exe gmail.com", because this would be recognized as having a ".com" extension.

    Here is how to get around this issue:

    1. Create a text file and type in it "start " followed by the URL you want to open.
    2. Change the extension of the text file to ".bat"
    3. Create a shortcut that points to the file you just created and follow the aforementioned steps.

    For example, I have created a shortcut called "Gmail" that points to a "Gmail.bat" that executes "start http://www.gmail.com". With this, Cortana would open Gmail with my computer's default browser when I say "Hey Cortana, open Gmail".

    Upon creating the shortcuts, you might notice that the default icon is quite uninformative. You can pick a better one after you created the shortcut by right-clicking on the icon, click [Properties], followed by clicking [Change Icon...]. Enter one of the following in "Look for icons in this file" textbox, where you should find a lot of icons to choose from:
    %SystemRoot%\System32\shell32.dll
    %SystemRoot%\System32\imageres.dll

    So here you go, try it out!

      My Computer


  2. Posts : 1
    Windows 10
       #2

    Thank you for the post. I have added gmail and facebook to the commands that Cortana can understand. I was looking for ways to programatically extend Cortana when I saw your post come up in the search results. This is by far the easiest way to add simple commands to open foreground applications. Thanks again!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 00:00.
Find Us




Windows 10 Forums