First post, by riverglen
This must be either very obvious or impossible. How do I pass a command line argument to a program? Something like dosbox edit -thisfile.txt
Larry
This must be either very obvious or impossible. How do I pass a command line argument to a program? Something like dosbox edit -thisfile.txt
Larry
You read the README under the section "3. Usage:" the command line option "Runs the specified command before running "name". Multiple commands can be specified. ... A command can be: an Internal Program, a DOS command or an executable on a mounted drive." and it doesn't help?
Then I can't think of anything.
Evidently I need to elaborate on what I'm trying to do. I have a spreadsheet that contains a macro which uses the Visual Basis shell() function to run an external program. That program is passed a file name argument obtained from the spreadsheet cell that has the focus when the macro is run. Works fine in Win98, but the external program that is being invoked won't run under more recent versions of Windows. It does run fine in DoxBox. So, I would like to rework the macro so that it calls DosBox, which would in turn run the external program, but I still need to pass the file referenced in the spread sheet as an argument to the invoked program.
Perhaps someone with less of a penchant for sarcasm would like to clarify whether DosBox supports this sort of an operation, and if so, what sort of syntax is needed to distinguish parameters that are intended to be passed to the file to be run, from command line parameters that are intended for DosBox itself. Just for the record, I did in fact read the "great Readme" file, wherein it invited people with further questions to participate in this forum.
Write down the commands as you would issue them at the DOSBox Z:\> prompt. E.g.
Z:\> mount C "C:\Some\Folder\Somewhere"
Z\> C:
C:\> myprogram.exe thefilename.xxx
When you have all that, you translate it into a number of command line arguments for DOSBox:
dosbox.exe -c "mount C 'C:\Some\Folder\Somewhere'" -c "C:" -c "myprogram.exe thefilename.xxx"
DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32
"great Readme"
Why are there quotation marks?
Thankyou MiniMax,
I assume that I could include all of the setup commands in the autoexec portion of the config file, and then issue a DosBox -c "name argument" comand? I noticed that you used nested quoutes in your example. Is that to account for the possibility of embeded blanks in the file path string? Does DosBox require the DOS 8.3 file name convention, or does it support extended file name notation?
For the mounting you can use any non-8.3 style, but you have to use
quotes if there are spaces in it.
Beware of when DOSBox carries out the different commands. I don't remember if the commands in the config-file is carried out before or after the command line arguments. Also, you can have DOSBox reading several config files.
DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32