1

Is there an program that you can type into command line or terminal with a set of parameters to run a 16 bit program? Such as: "run16bitprogram.exe 'path/to/program/test.exe'" and just output whatever the program does in the console.

If there are such programs, i would like them to be cross platform if possible.

Here is an example image of the dosbox executed from Java: enter image description here

Here is the config file: enter image description here

Here is the code from java (ProcessBuilder did not even open DOSBox):

Runtime.getRuntime().exec(new String[] { "C:/Program Files (x86)/DOSBox-0.74/DOSBox", "-conf \"C:/Users/Braden Steffaniak/Documents/GitHub/Workspace/ArrowIDE/res/assembly/new.conf\"", "-noconsole" });

The -noconsole command works, but if I add any -c parameters, it does not do anything.

If I type the command in command prompt, it works as I expect it to.

2 Answers2

2

It's definitely not possible on Windows, see the following MSDN article: http://support.microsoft.com/kb/896458

Any tool that will allow you to run a 16bit prog on a 64bit Windows system has to emulate a system, which is what DOSbox does.


The following works:

public class DosBoxCaller {
    public static void main(String[] args) {
        ProcessBuilder pb = new ProcessBuilder(
                "C:\\Program Files\\DOSBox-0.74\\DOSBox.exe",
                "-conf C:\\Users\\Y\\dosbox.conf");
        pb.directory(new File("C:\\Users\\Y"));
        pb.redirectErrorStream(true);
        try {
            Process p = pb.start();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

If this doesn't call DOSBox for you, then you're probably getting a path wrong and simply ignoring the exception that is being thrown. Also doublecheck that your conf option is valid, and use a modified copy of the fullfledged dosbox config (to be found at your user folder\Application Data\Local\DosBox, copy it to your favorite folder, then edit autoexec).

us2012
  • 152
2

There's an emulator which can run simple commandline DOS programs in Windows x64. It's called "MS-DOS Player for Win32-x64". The source is provided, so in theory you can implement missing functionality.

http://takeda-toshiya.my.coocan.jp/msdos/index.html

igorsk
  • 121