OnExit command line issues

Known Issues and Problems with BCI2000
Locked
stefan
Posts: 13
Joined: 22 Oct 2009, 16:43

OnExit command line issues

Post by stefan » 04 Sep 2013, 17:24

Operator script commands using --OnExit from the command line don't seem to get executed until completion anymore when using SYSTEM, e.g.

Code: Select all

operator.exe --OnExit "-SYSTEM start%20cmd.exe"
If I observe it correctly, when I quit the operator this pops up a command window just for a fraction of a second but then it gets taken down with BCI2000. It used to stay up in version 2. Any thoughts?

Win7, BCI2000 v3.0.5 (rev 4229)

Edit: Noticed that the window that pops up is just the system log window, and it briefly shows a red error message but doesn't stay up long enough to read it

stefan
Posts: 13
Joined: 22 Oct 2009, 16:43

Re: OnExit command line issues

Post by stefan » 10 Sep 2013, 12:49

Dug a little deeper, so it looks like in CommandInterpreter::Execute() the string that gets passed in is

Code: Select all

"SYSTEM%20start%%20cmd.exe"
It appears like this string was encoded incorrectly (or twice?) and the command interpreter then fails to tokenize the command and select the appropriate action (system) and it throws a "Cannot make sense of "SYSTEM%20start%%20cmd.exe"" error. In contrast, if I pass in the same script command with --OnConnect, everything works as expected (string passed to Execute() is "SYSTEM start%20cmd.exe"). Something seems to be different in the handling of --OnExit.

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: OnExit command line issues

Post by mellinger » 12 Sep 2013, 15:58

Hi Stefan,

thanks for your concise bug report. The bug has been fixed.

OnExit is indeed handled differently, by the Operator application itself rather than the OperatorLib, which implements the remaining events.

In the meantime, BCI2000 startup batch files have been rewritten to use Operator scripting commands. Using this new feature, you will no longer need to specify scripting commands on the command line, which is supposed to make batch files clearer, and easier to maintain.

Regards,
Juergen

stefan
Posts: 13
Joined: 22 Oct 2009, 16:43

Re: OnExit command line issues

Post by stefan » 13 Sep 2013, 13:09

Hi Juergen,

Thanks for the quick fix! Everything is working fine now.

We have a number of somewhat elaborate batch scripts that start up our BCI environment and we are in the process of porting this from BCI2000 v2 on XP to v3 on Win7, so for the moment it was easier for us to keep the old format but I assume in the future we will move to the new Operator scripting commands also.

Thanks again,
Stefan

Locked

Who is online

Users browsing this forum: No registered users and 0 guests