Fix usage of ~ character to work on Windows.

Refs #10111