don't use mame32 it saves it settings in the registry they are used when launched from the commandline. use the normal commanline version.
the prefered way to set basic stuff of is in mame's ini file.
from the commandline :mame.exe -cc
it will create mame.ini for you in it there is an option to enable a joystick. see for options windows.txt in your mame folder
alternatively you can use the cfg utility in the fe to add a commandline options to mame in the emulator section of the list mnanger (or add it to cfg\emulators\femamecloptions.txt by hand)
10|mame|-joy| or something like that will enable the joystick for all games that use the mame emulator. see how to setup commandline options in the fe docs, docs\fereadme.htm
Read the manual! Reading manuals empowers

peter