Hi Joseph !
I am also running OpenHAB2 on a Windows 7 machine (ZOTAC Nano CI320) and I have many rules with executeCommandLine without any problem.
I tried to reproduce your use case :
rule "Un test"
val input = executeCommandLine("C:\\OH_utils\\head@@-n@@1@@C:\\OH_utils\\essai.txt", 1000)
logInfo("DEBUG", "From essai.txt : " + input)
if (input.contains("first")) logInfo("DEBUG", "the line contains <first> !")
It works fine with this output in openhab.log :
2018-01-16 10:56:29.784 [INFO ] [eclipse.smarthome.model.script.DEBUG] - From essai.txt : This is the first line of my file...
2018-01-16 10:56:29.792 [INFO ] [eclipse.smarthome.model.script.DEBUG] - the line contains <first> !
I don’t understand why it does not work for you. Just one point : essai.txt is in the same directory as head.exe, but if I don’t use the full path of essai.txt, I get an error.
To be sure of your setup, have you tried a very simple rule as :