Onenote Command Line Interface

OneNoteCLI is a command line interface to OneNote 2016, 2012, and 2010 that allows you to automate the process of creating, deleting, and appending to OneNote pages from both the command line and from batch files.

OneNoteCLI offers the following features from the command line:

  • Create a note
  • Delete a note
  • Create a section
  • Delete a section
  • Append text to a note
  • Import a directory of text and image files

All actions return an exit code that can be detected from a Windows batch file.

Import a Directory of Text and Image Files

One of the most powerful features of OneNoteCLI is the ability to bulk import text files and images, recursively, into a OneNote workbook. With a simple command line you can import 1000’s of notes and sync them to the cloud.

Here’s an example command line to import a directory tree of text notes into an existing notebook:

OneNoteCLI.exe importfolder -n "Test Notebook" -r -d -p "c:\temp\Notes"

Where -r means recursive, and -d means create a Section per directory.

The above command line, when ran on this directory:

OneNote import directory of text files

This is a directory of text files that is to be imported into OneNote.

Will result in the following notes being created in OneNote:

OneNote with a section created per text file

You can see that each directory created a section, and each text file was imported as a note.

In addition to importing text files, OneNoteCLI imports JPG, GIF, BMP, TIF, and PNG files. Each image is imported as it’s own page with the title of the page matching the image filename.

Date and Time

OneNoteCLI uses the date and time stamp of the imported file as the date/time stamp for the created notes. This way you can maintain the integrity of your notes even when doing a mass import.

OneNote Command Line Interface

The OneNoteCLI command line follows the standard:

OneNoteCLI verb [-option "text"] [-option "text"]

The following verbs are supported:

  • importfolder
  • createnote
  • createsection
  • deletenote
  • deletesection
  • appendnote

OneNoteCLI can print a summary of the command line interface if you run it without any parameters:

Copyright c  2019
  No verb selected.
  importfolder     Import a folder
  createnote       create a note
  createsection    create a section
  deletenote       delete a note
  deletesection    delete a section
  appendnote       append to an existing note
  help             Display more information on a specific command.
  version          Display version information.

If you run OneNoteCLI with just a verb it will print the options for that verb:

C:\temp>OneNoteCLI createnote
Copyright c  2019
  Required option 'n, notebook' is missing.
  Required option 's, section' is missing.
  Required option 't, title' is missing.
  Required option 'b, body' is missing.
  -n, --notebook    Required. (Default: ) Notebook name
  -s, --section     Required. (Default: ) Section name
  -t, --title       Required. (Default: ) New note title
  -b, --body        Required. (Default: ) New note body
  -w, --wait        (Default: false) Wait for keypress
  --help            Display this help screen.
  --version         Display version information.

Create Notes With Batch Files

OneNoteCLI returns exit code 0 on success, and non-zero on fail. This allows for easy scripting of creating and deleting notes and sections, and even appending to existing notes.

Universal Command Line Interface To OneNote

OneNoteCLI provides a universal command line interface to OneNote that is scriptable. If there are more features that you need implemented let us know in the comments below and we’ll see if it’s possible to add them.


No installation is necessary, OneNoteCLI can be simply unzipped into a directory and ran from there.

There are 2 files in the zip package that need to be present to run.

  • OneNoteCLI.exe – This is the main program that runs
  • CommandLine.dll – This is an excellent command line parser for .NET

Download the zip file here: OneNoteCLI (154 kb)

Body SHA-256: 27f84714a2cf050dfc27b878031b8bfc2e4b71b031be3920ec3d21c36f6e7bf

AntiVirus Scan: Virus Total Scan Report



  • I failed to to download “” from your given link:

    It shows 404 Page Not Found, – I think it’s broken.

    Can you fix that? Thanks.

  • Hello,

    I am trying to use your tool that could suit my needs.

    I come across concerns that I go back to:
    OneNoteCLI.exe createnote -n “TEST” -s “section” -t “title” -b “Body”
    Create note: title
    ERR: That notebook does not exist: TEST

    In the createnote function, would the -p parameter be useful to define the location of the new note be create?

    • The “createnote” function does not have the ability to create a notebook. You need to make sure that the notebook already exists. Also, OneNote is case sensitive, so if you want to use “TEST” then make sure that your notebook is actually called “TEST”.

  • And thank you for thinking of this tool that can serve a few people

  • Hi,

    thank you for OneNote CLI. Do you have any plans to extend the functionality to listing existing entries and reading the contents of an entry?

    Have a very nice day.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.