i have a script which 3 arguments, two of which are paths. I would like to call it from a .bat file.
python myscript.py "%~dp0inputs/" "%~dp0outputs/" "foo"
If i call a dummy script that simply prints argv using the above line, i get the expected results, even for paths containing spaces:
myscript.py
C:\path\containing spaces\inputs/
C:\path\containing spaces\outputs/
foo
however if i use this (ie %~dp0 for argument 1 with nothing else between the quotes):
python myscript.py "%~dp0" "%~dp0outputs/" "foo"
then it behaves oddly when the path contains spaces:
myscript.py
C:\path\containing spaces" C:\path\containing
spaces\outputs/ foo
it seems that the quotes have not been processed properly - what have i done wrong?
%~dp0the string needs to end with/for being processed properly. What happen if you pass"%~dp0/"?