Hi Koroth,
I just stumbled across this and it looks like my situation about half an hour ago. FFB working in mame when ran from the ui but not from the command line.
If it's the same as mine then it's not picking up the ini file / flag when you're booting mame from the command line but it is picking it up when booting through the ui.
The simplest check is to open a command prompt and head to your mame directory then
mame64.exe -output windows vr
This is assuming you have virtual rally setup and working with ffb. Note: No .zip extension to be added on the rom.
Straight in the command line,
no batch files yet.
If that works then it indicates that the ini file which Mame is loading for the ui isn't being loaded for the command line.
Next step is to add the ini file.
mame64.exe -inipath c:\path\to\mame\folder -output windows vr
Add the absolute path to the ini file's containing directory, no filename needed. This assumes that the ini file has "output windows" set in it.
Assuming you still have ffb at this point, drop the -output windows from the command. If the ffb is still working (bear in mind that it can be a little sporadic if you are continually starting and stopping stuff) then all is good. If not then it's time to look into the path to the ini file and make sure it's setup correctly.
Next step would be to try a shortcut. Create a shortcut to the mame64 exe, right click and hit properties, surround the path to the exe in double quotes " then add on the full path the ini folder as above. No idea why but without the quotes around the path it works consistently for me.
Give it a bash and see if it behaves any better. I think I had the best part of an hour digging through and trying to figure out what the difference was between the UI and the command line and taking the steps above seemed to solve the problem.
I deleted all preset and example ini's because I don't use them anyway. No change.
I put my .bat file in the Mame folder so I don't have to use paths with quotes. No change.
I tried a short command-line and a version with more variables. No change.
I tried copying Boomslangs bat file. No change.
I launched sfrush. No change.
I tried a fresh install of Mame and my existing one. No change.
Everything workes directly in Mame, but not from command-line. I have been at it for months now, but I can't figure out what is wrong. So I am ready to let it go. I even created a script that launches the games directly from mame's menus and that works quit reliably.
I want to thank you both, PL1 and Boomslang for your time and comments!