The issue is the way windows handles spaces in arguments.
If I want to run darktable from a terminal I have to run the command this way:
"C:\Program Files\darktable\bin\darktable"
If I want to start darktable and open a file, then this is the command:
"C:\Program Files\darktable\bin\darktable" C:\Users\username\Pictures\IMG_1234.cr3
But if I have a username that is user name then I have a problem. If I try
"C:\Program Files\darktable\bin\darktable" C:\Users\user name\Pictures\IMG_1234.cr3
I get an error about the file not being found. So I think if I wrap the image argument in quotes like this:
"C:\Program Files\darktable\bin\darktable" "C:\Users\user name\Pictures\IMG_1234.cr3"
then that should work. But, it doesn’t. In order to pass 2 quoted arguments to windows you have to do this:
""C:\Program Files\darktable\bin\darktable" "C:\Users\user name\Pictures\IMG_1234.cr3""
To implement this I need to rethink the whole windows sanitizing problem, implement it, then test every library and script in the repository. On windows.