# Automate opening of DOS program under DOSBox / Windows 7

I use DOSBox and it works pretty well, but each time I want to run the application I have to launch DOSBox, then type:

mount c c:\path\to\app
c:
cd app
app.exe


Can I somehow automate the process, like with a batch file or something?

Or are there other DOS emulators that let you launch programs easier?

-

DOSBox has this feature itself, defined on the configuration file:

You can save yourself some time by having DOSBox automatically MOUNT your folders and change the drive to C:. In original DOS based operating systems a file called AUTOEXEC.BAT contained any commands that the user wanted executed every time the computer booted up. This functionality is simulated by the [autoexec] section of the dosbox.conf file.

-

I have done this in VB using:

dos32Proc = Diagnostics.Process.Start("C:\Program Files (x86)\DOSBox-0.74\DOSBox.exe", " -c mrpd");
dos32Proc.WaitforExit()


mrpd is a bat file, and will execute several lines in the DOSBOX command prompt and finish with the exit command. You will also need a mount command to ensure you are in the correct directory for the command prompt.

-