Problems with spaces in paths when calling a batch file from R

前端 未结 2 1199
耶瑟儿~
耶瑟儿~ 2021-01-22 14:46

I have some problems to call a command line program called molconvert from R using system() in Windows. molconvert is located in \"C:\\Program Files\\ChemAxon

2条回答
  •  旧时难觅i
    2021-01-22 14:57

    the easiest way to fix this is to use short paths:

    for %%a in ("C:\molecule conversions\cembrene A.mol") set "sh_path=%%~dpfnxsa"
    

    or

    for %%a in ("C:\Program Files\ChemAxon\MarvinBeans\bin") do set "pf_sh_path=%%~dpfnxsa"
    

    and then to pass %sh_path% and %pf_sh_path% as parameter.

提交回复
热议问题