[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[HTCondor-users] Windows batch file parameter with spaces


I'm trying to pass the path of Rscript, stored as a variable on the execution machine, as a parameter to a batch script. The path is however split at the space when passed to the batch file.

On the execution node, the owner will have

HAS_R = True
R_PATH = "C:\Program Files\R\R-3.1.1\bin"

On the submission machine, the submission file contains

Executable = run$$(OpSys).bat
transfer_input_files = test.R
arguments = $$(R_PATH) $(Process)

The batchfile runWINDOWS.bat is just a simple test script:

echo "A" %~f1
echo "B" %~dp1
echo "C" %~ftza1
echo "D %~1
echo "E %1

%~1%\Rscript.exe test.R %2

Output from the batchfile

"A" C:\Program\
"B" C:\Program\
"C" C:\Program\
"D C:\Program\
"E C:\Program\

All solutions I found points to using %~1 to keep the path together. Clearly not today. :) Our current solution is to specify the version as well on the execute node, thus providing a way to check for the version and run a specific batch file (run$$(OpSys)$$(HAS_R_VER).bat .

Any ideas?

Kind regards

Hannes Calitz