There's no easy way to do this, but you can achieve this by first batch renaming all the files with progressive numbers (Use '#' as template in batch rename tool) and then use the batch processing tool to add the file name in the image (Use 'Add text' with '<Filename>' parameter). It's not perfect, but it's better than nothing.
If you want to try this, I would recommend using XnViewMP because its Add text tool has more features.
XnView Tweak UI - Tool to customize your XnView beyond the regular XnView options. UI-less Settings - Documentation of all the hidden settings in XnView. XFAM - Tool to create and customize XnView file associations.