If the agent is launched as a command line application, but from an external software (i.e. custom launcher, console application), any UserParameter configured raise an Access violation exception. The error returned is 0x00000005.
A possible workaround consists on passing the CREATE_BREAKAWAY_FROM_JOB parameter to the CreateProcess() function inside the src\libs\zbxexec\execute.c file (line 322 on version 1.9.8 beta)