The task to schedule is something like:
notepad.exe "D:\ben's notes\foo.txt"
After some digging I managed to get the /TR parameter to accept the spaces:
"notepad.exe \"D:\ben's notes\foo.txt\""
However schtasks.exe also replaces every single quote to a double quote:
notepad.exe "D:\ben"s notes\foo.txt"
Is there any way I can escape that inner single quote or something?
I ended up using this: Task Scheduler Managed Wrapper