Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Jan 8 '13 at 9:23

This question came from our site for professional and enthusiast programmers.

1  
Not possible in general, see below. However, if you told us what you don't like about DOSbox, maybe we can find a better solution for you? –  us2012 Jan 8 '13 at 0:29
    
Well, nowhere on all of that can I see a reference to the exe file you want to run. How is dosbox supposed to know what you want to run? That should go in your autoexec, not just the mounting. Besides, I think there's something wrong about the way you're using the config, but I'll check... –  us2012 Jan 8 '13 at 1:39
    
What I am trying to do in the pictures shown is get a simple command to run on DOSBox, not go the full mile yet. I will move on to that when I can get a simple mount command to work. –  Braden Steffaniak Jan 8 '13 at 1:41
    
Updated my answer, your problem is most likely related to wrong paths or a wrong config. I have a working solution with ProcessBuilder for you below. –  us2012 Jan 8 '13 at 2:01
add comment

2 Answers 2

up vote 1 down vote accepted

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).

share|improve this answer
    
I am fine with it emulating a system, I just do not want it to open a window to specifically run the program. –  Braden Steffaniak Jan 8 '13 at 0:43
    
@BradenSteffaniak Could you elaborate on what that 16bit program does. I don't really see the problem with the command prompt window that DOSbox opens, you can always minimize that? –  us2012 Jan 8 '13 at 0:53
    
The 16 bit program is in assembly language. The problem I have with DOSBox is that I am trying to run it through java's ProcessBuilder, and it will not accept and "-c" arguments which I need to navigate to the directory and run the program without having to type it in every time. –  Braden Steffaniak Jan 8 '13 at 0:58
    
@BradenSteffaniak Can you not simply call DOSBox through the ProcessBuilder and let the automatic start of your program through DOSBox's autoexec.bat as described here: dosbox.com/wiki/AUTOEXEC ? –  us2012 Jan 8 '13 at 1:01
1  
@BradenSteffaniak What doesn't work when you try that? It's really hard to help you if you always hide half of the info you have... –  us2012 Jan 8 '13 at 1:18
show 3 more comments

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://homepage3.nifty.com/takeda-toshiya/msdos/index.html

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.