Help creating a batch file

General information and assistance with DOSBox.

Help creating a batch file

Postby alanmac » 2018-6-14 @ 09:11

I have installed and set up DOSBox and it is working fine. I can run the DOS application I need. Now I want to create a batch file that will launch DOSBox, mount the folder, change the drive and run the DOS application. I have created the batch file and it launches DOSBox and I have the DOS prompt, but thereafter I am stuck. To put it simply I want the batch file to place commands at the DOS prompt in DOSBox, and to simulate an ENTER. As each command had been executed I want it to move on to the next command. If I can only get it to mount the drive I will be able to figure out the other commands. Any help will be much appreciated.
alanmac
Newbie
 
Posts: 6
Joined: 2018-6-14 @ 08:49

Re: Help creating a batch file

Postby dr_st » 2018-6-14 @ 09:54

Welcome to the forum.

This should really be in DOSBox, and not in DOS.

You should create the batch file in the DOSBox environment (probably inside the folder that gets mounted), then add lines in DOSBOX.CONF, in the Autoexec session to mount the drive, and execute your batch file.
User avatar
dr_st
Oldbie
 
Posts: 1435
Joined: 2015-4-09 @ 07:18

Re: Help creating a batch file

Postby spiroyster » 2018-6-14 @ 10:54

You can use the "-c" command line argument to run multiple commands without need of another batch script in dosbox...
https://www.dosbox.com/wiki/usage#Comma ... Parameters
User avatar
spiroyster
Member
 
Posts: 394
Joined: 2015-10-12 @ 12:26

Re: Help creating a batch file

Postby collector » 2018-6-14 @ 13:15

Note in the future that you should ask DOSBox question in the DOSBox forums. viewforum.php?f=53
User avatar
collector
l33t
 
Posts: 4245
Joined: 2003-1-15 @ 10:39

Re: Help creating a batch file

Postby alanmac » 2018-6-14 @ 13:40

Thank you for your prompt replies, and welcome. If you would like to move this to DOSBox please do so. I am afraid I need a bit more help, sorry. How do I create a batch file in the DOSBox environment? I used Notepad to create this batch file and posted it on my Desktop. What I have coded does launch DOSBox. All that would seem to be wrong, I think. Regarding adding a line to the Autoexec session, I am using Windows 10 and am new to this. I thought Autoexec.bat had been dropped? Am I wrong on this?
alanmac
Newbie
 
Posts: 6
Joined: 2018-6-14 @ 08:49

Re: Help creating a batch file

Postby dr_st » 2018-6-14 @ 13:51

  1. Think of it as two batch files - one that just runs DOSBox, put this one on your desktop; the second one will run INSIDE DOSBox, put it inside the folder which DOSBox will mount.
  2. DOSBox has a config file, named DOSBox.conf. It can be in the DOSBox directory, or somewhere in %Appdata%, in which case there will be a batch file to edit it. At the end of the config file there is an [autoexec] section. Lines there will be automatically executed when DOSBox loads, as if you ran them from the DOSBox commandline. There you should place the commands to mount your folder, and run your application.
User avatar
dr_st
Oldbie
 
Posts: 1435
Joined: 2015-4-09 @ 07:18

Re: Help creating a batch file

Postby alanmac » 2018-6-14 @ 14:21

Thanks. Still struggling. I do have one batch file on my Desktop which launches DOSBox. But how to create another. If I go to Appdata, where I have DOSBox.conf I cannot see how to edit it. Or where is this batch file I can use to edit it?
alanmac
Newbie
 
Posts: 6
Joined: 2018-6-14 @ 08:49

Re: Help creating a batch file

Postby zirkoni » 2018-6-14 @ 14:30

DOSBox.conf is just a text file you can edit with any text editor (Notepad, Wordpad, etc.)
You do know how to open files, right?
User avatar
zirkoni
Member
 
Posts: 168
Joined: 2014-7-17 @ 08:54

Re: Help creating a batch file

Postby alanmac » 2018-6-14 @ 14:39

Got it! I have edited DOSBox.conf with the lines I need to launch my program and it works great. Many thanks. I thoroughly deserve the sarcasm.
alanmac
Newbie
 
Posts: 6
Joined: 2018-6-14 @ 08:49

Re: Help creating a batch file

Postby alanmac » 2018-6-19 @ 07:26

Can I ask one further question. How, when I exit the DOS program, can I automatically close the two DOSBox windows? Or is it possible when the DOS application has launched that only that application window opens, and not the DOSBox Status Window. And then when the DOS program has been closed the only window to close is the window it appeared in. How can I make the running of the DOS program appear exactly as it would if it was compatible with W10?
alanmac
Newbie
 
Posts: 6
Joined: 2018-6-14 @ 08:49

Re: Help creating a batch file

Postby dr_st » 2018-6-19 @ 07:45

Try to add 'exit' to the end of the [autoexec] section in dosbox.conf.
User avatar
dr_st
Oldbie
 
Posts: 1435
Joined: 2015-4-09 @ 07:18

Re: Help creating a batch file

Postby alanmac » 2018-6-19 @ 08:24

Thank you
alanmac
Newbie
 
Posts: 6
Joined: 2018-6-14 @ 08:49

Re: Help creating a batch file

Postby Stiletto » 2018-6-29 @ 14:25

Moved.
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 4121
Joined: 2002-7-01 @ 21:57


Return to DOSBox General

Who is online

Users browsing this forum: Silent Supporter and 0 guests