Whitespace is important.
The space within Program Files is making that first file path be interpreted as two separate arguments, and it doesn't know how to interpret the first one, C:\Program as a command.
I've made a few similar examples to illustrate what works and what doesn't:
File paths that use no spaces
>>> import os
>>> os.system('C:\ProgramData\Miniconda3\python.exe --version')
Python 3.9.1
0
>>> os.system('cmd /c "C:\ProgramData\Miniconda3\python.exe --version"')
Python 3.9.1
0
>>> os.system(r'cmd /c "C:\ProgramData\Miniconda3\python.exe --version"')
Python 3.9.1
0
These 3 versions are all successful because C:\ProgramData\Miniconda3\python.exe, the file path in question, has no spaces in it.
File paths with spaces and \u
This command doesn't work:
>>> os.system('C:\Program Files (x86)\LilyPond\usr\bin\python.exe --version')
File "<stdin>", line 1
os.system('C:\Program Files (x86)\LilyPond\usr\bin\python.exe --version')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 31-32: truncated \uXXXX escape
because it contains \u (in ...\usr\...). When you use \u as part of a string, python expects it to be a part of a Unicode escape sequence (e.g. print("\u2019") will get you a special apostrophe)
The way to fix this is to either escape your backslashes with another backslash (e.g. 'C:\\ProgramData\\...') or by making it a "raw" string with a prefixed r: r'C:\ProgramData\...'
That gets us here:
>>> os.system(r'C:\Program Files (x86)\LilyPond\usr\bin\python.exe --version')
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
1
which is the problem I initially described; spaces are used to break up commands/arguments and cannot plainly be included in file paths.
The solution is to put quotes around the whole file path which contains a space:
>>> os.system(r'"C:\Program Files (x86)\LilyPond\usr\bin\python.exe" --version')
Python 3.7.4
0
These same things apply when the command is being sent as an argument:
>>> os.system(r'cmd /c "C:\Program Files (x86)\LilyPond\usr\bin\python.exe --version"')
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
1
>>> os.system(r'cmd /c ""C:\Program Files (x86)\LilyPond\usr\bin\python.exe" --version"')
Python 3.7.4
0
Conclusion
So it seems that your line should look something like this:
os.system(r'cmd /c ""C:\Program Files (x86)\ABBYY FineReader 15\FineReaderOcr.exe" skan.JPG" /send Clipboard')
(though I don't know what the /send Clipboard part is for, and so may need adjustment from this. However, this should address the error asked about in the question)
subprocess. This replaces os.system and os.spawn*. docs.python.org/3/library/subprocess.html