EXEC Binding not working with Windows 10 command

Added the rule. not it has an warn message:

2019-07-18 08:26:13.525 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP POST request at 'items/pbalogo' with an invalid status value ''.

rule "testing batch"
   Item pbalogo_file received command
   var execresult = executeCommandLine( "C:\\openhab2\\conf\\scripts\\PBAplay.bat C:\\DOCS\\PBALogo.mp4",  3000)
   logInfo("test", "result: " + execresult)

Put the value ON in the habpanel button and get this response but nothing runs:

2019-07-18 08:51:25.015 [ome.event.ItemCommandEvent] - Item 'pbalogo' received command ON
2019-07-18 08:51:25.026 [nt.ItemStatePredictedEvent] - pbalogo predicted to become ON
2019-07-18 08:51:25.034 [vent.ItemStateChangedEvent] - pbalogo changed from NULL to ON
2019-07-18 08:51:25.116 [vent.ItemStateChangedEvent] - pbalogo changed from ON to OFF

Don’t know why you did that. We already know that your batch file is being run by exec.

We don’t know if your batch file likes the parameter that is given to it. The output from the rule would be really useful.

The WARN message has nothing to do with the rule or the pbalogo_file that you were using from habpanel. But now you’ve decided to do something else, so I don’t suppose the rule gets triggered.
The WARN is about you not getting your pbalogo habpanel correct to begin with.

The batch file is not run, it starts the command processor, but doesn’t start the batch. I eliminated the parms and just let it execute the windows media player. but nothing ran. It seems to try to run in background without a window.

how do I get the output from the rule.

ok, fixed the habpanel and got this:

2019-07-18 15:19:20.821 [INFO ] [.eclipse.smarthome.model.script.test] - result: 
C:\openHAB2\userdata>echo off 
Press any key to continue . . . 
'reg' is not recognized as an internal or external command,
operable program or batch file.
The filename, directory name, or volume label syntax is incorrect.
'reg' is not recognized as an internal or external command,
operable program or batch file.

Sorry, missed your reply, because it was not a reply to anyone.

Okay; I don’t know who reg is - you’ll need to look into your batch file to see what that is about.

I’m Including the batch file so you can see what I want to accomplish…

echo off
reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeLoop" /t REG_DWORD /d 1 /f
"C:\Program Files\Windows Media Player\wmplayer.exe C:\Docs\PBALogo.mp4 /fullscreen
reg add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeLoop" /t REG_DWORD /d 0 /f

reg is a registry command to set the mp4 file to continuos loop,
wmplayer plays the video
the second reg sets it back to normal.

The question that I have now is does the exec bind only run processes in the background.

In the context that the batch is being run, it has no access to reg. This is Windows permissions stuff.

I think so. If you want windows to pop up or something, then that is something you need to put in your batch/script.

Hello, I am finally able to get back to this problem. I got the batch file to execute but I can’t get it to open a window to run the MP4 file. Here’s what shows on the log and event files.

2019-08-15 09:26:31.924 [INFO ] [.eclipse.smarthome.model.script.test] - result: 
C:\openHAB2\userdata>echo off 
The operation completed successfully.

The operation completed successfully.

2019-08-15 09:26:31.701 [ome.event.ItemCommandEvent] - Item 'pbalogo_file' received command ON
2019-08-15 09:26:31.702 [nt.ItemStatePredictedEvent] - pbalogo_file predicted to become ON

echo off
cd "C:\Program Files\Windows Media Player\"
C:\windows\system32\reg.exe add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeLoop" /t REG_DWORD /d 1 /f
wmplayer.exe C:\Docs\PBA_LOGO_SFLx.mp4 /fullscreen
C:\windows\system32\reg.exe add "HKCU\Software\Microsoft\MediaPlayer\Preferences" /v "ModeLoop" /t REG_DWORD /d 0 /f

Thing exec:command:pbalogo  [ command="start /D C:\\openhab2\\conf\\scripts /I /MAX /REALTIME PBAplay.bat", interval=0 , autorun=false ]

Switch pbalogo  {channel="exec:command:pbalogo:run"}
String pbalogo_file  {channel="exec:command:pbalogo:input"}

PS: when I run the batch file directly it opens a window and works fine.

Can anyone explain how the EXEC Bind opens a command on the windows system. That may provide a clue as to how to resolve this. Thanks