executeCommandLine does not run batch file

What I see is that OH is running with the username “SYSTEM” while the logged in user is different. But here I double checked again that BOTH users have full permission to the OH folder where I run the scripts as well as have permission to the drive “D:” where I write the output.

I do not understand what the

ps1'

in the third row is for.
Removing it would just result in getting rid off the second half of the returned error message.
What if you add the complete path of the powershell command ( c:.….…\powershell.exe )

This is becoming very basic and non-openhab related…
there is NO reason for escaping or double quoting the powershell command in the russ.bat
if powershell is not executed probably the path to powershell for user SYSTEm is not set. Then you need to provide the whole path.

please use as described above:

\path-to-directory\powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\openhab\conf\scripts\test.ps1"

in test.ps1 write:

write-output "123 test"

@Oliver2
yeah you are right. For some “strange” reasons the powershell has not been started. Now with the call

%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\\powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\openhab\conf\scripts\test.ps1"

everything is working and the output is written to the drive D: Thanks a lot.

:slight_smile:

@Wolfgang_S
also many thanks to you for the great help