You can simply use %* to pass everything that was passed to the .bat file to anything else.
Note that if you pass "words with spaces" to the batch file, it will be seen as 1 parameter in quotes and passed as that. If you ommit the "", the batch will still forward it to the program, but the program will see it as separate parameters. It really depends on how the batch file is called to know if those quotes will be there or not and if needed. For example, if you drag and drop a file in explorer onto the batchfile, explorer will add the quotes for you. If you type manually from the command prompt, its up to the user to check for the quotes.
So:
program.exe %0
should be enough in your case.
Also, from commandline, if you autocomplete filenames with the tab, quotes are automatically added if they are necessary, and even while the quotes may make it seem that you have to edit them out in order to continue typing, you really don't have to. Command prompt is smart enough.
Example: here I type prog, press tab twice, then continue typing and press tab once more.
C:\>_
C:\>cd prog_ (tab)
C:\>cd "Program Files"_ (tab)
C:\>cd "Program Files (x86)"_
C:\>cd "Program Files (x86)"\Micro_ (tab)
C:\>cd "Program Files (x86)\Microsoft Office"_ (enter)
C:\Program Files (x86)\Microsoft Office>_
Hi there, and welcome to SuperUser. We're not a "Please write me a script" kind of website. If you share us your script, we can help you narrow down why things aren't working though. That said, it is a bit hard to understand your goal, and an accompanying script would definitely help with that. – LPChip – 2018-11-13T11:07:09.967
The basic problem is that there are 2 .exe's: one for the 32 bit version, and one for the 64 bit version. Let's call them program32.exe and program64.exe. These names can't be changed at the moment. However, I want to write generic scripts that call on of thes .exe's depending on the installation. I just have to know how in DOS you can pass arguments in a quoted way. I don't need a real script. I need 1 onliner. Eg: if i type: – Francky Leyn – 2018-11-13T11:41:18.873
'main.bat "filename with spaces.jpg"', this must be , for the 64 bit version, reult in the DOS system call 'program64.exe "filename with spaces.jpg"' – Francky Leyn – 2018-11-13T11:44:49.397