Search code examples
cmdonenote

How do I execute OneNote UWA from Windows command-line?


I can't figure out how to start the OneNote UWA from Windows command-line. The best I could do is find where it's installed. However, I don't know how to actually start it up from the command-line; as, the executables in that directory don't start OneNote UWA.

 C:\Program Files\WindowsApps\Microsoft.Office.OneNote_16001.11901.20096.0_x64__8wekyb3d8bbwe

PS: I tried to use the same command-line that's in Windows TaskManager (below). However, the app doesn't startup nor does it give an error; even with elevated privileges.

enter image description here

 "C:\Program Files\WindowsApps\Microsoft.Office.OneNote_16001.11901.20096.0_x64__8wekyb3d8bbwe\onenoteim.exe" -ServerName:microsoft.onenoteim.AppXxqb9ypsz6cs1w07e1pmjy4ww4dy9tpqr.mca

I'd really appreciate any help suggestions to do this. If this is not possible (or nobody knows the answer, I would also be happy if someone knows how to associate a global hotkey to OneNote UWA.


Solution

  • I followed this tutorial and it worked great for me: Launch Metro app from command line

    my resultant command was this:

    explorer.exe shell:AppsFolder\Microsoft.Office.OneNote_8wekyb3d8bbwe!microsoft.onenoteim
    

    which launched into OneNote (metro/winrt/uwa version and not the desktop version)

    There is a shortcut you can do that would have worked in my case. When you look at the target of the shortcut you create... instead use this command line tool to get the full target (since you can't copy from the target box in the shortcut properties window) and then use this instead:

    explorer.exe shell:<target value>
    

    get the command line tool here: LNK file parser

    careful though because the value wraps when you use the LNK file parser in a command window. You can output the result text from lnk_parser_cmd to a text file to ensure you get the correct value. Their example is:

    lnk_parser_cmd.exe shortcut.lnk
    

    you would simply use:

    lnk_parser_cmd.exe shortcut.lnk > result.txt
    

    and then you can easily copy and paste the non-wrapped text from result.txt.