7

Is there a way that I can start the Win32 environment or run Win32 programs from DOS without starting the Windows GUI?

I'm using a Windows 98 PC that is booted into DOS mode from a floppy disk.

EDIT:

I want to run command line programs. Some of these are Digital Mars C and .NET Framework.

12

No Microsoft-supported way to do it

Windows GUI cannot be separated from the kernel and runtime libraries that support Win32 programs (in Windows 98).

You can get Windows without the GUI only using Server Core install mode in Windows Server 2008.

3rd party Win32 emulation for DOS

There is a software that emulates Win32 API and allows Windows console programs to be run under DOS. For example, HX DOS Extender homepage says:

HX DOS-Extender is a free DOS extender with built-in Win32 PE file format support. Usually the purpose of a DOS extender is to make protected-mode features available for DOS applications. HX fully supports this goal, but goes some steps further. A Win32 API emulation layer is part of HX which allows many Win32 console applications to run in DOS.

Digital Mars C++ is specifically supported by HX DOS Extender, however .NET is integrated deeply into Windows. I doubt you'll be able to run .NET software on an emulator.

Warning, possible malware in HX DOS Extender download!

Apparently there is something fishy with downloads available on HX DOS Extender web site. Virustotal report looks really suspicious to me, most antiviruses report some kind of malware inside.

6
  • +1 DOS in Windows 98 is 16 bit. The Windows GUI is a 32 bit wrapper on top of that. For Windows 3.1, there was some Win32 library hacks, but that was never extended to DOS (AFAIK).
    – Trav
    Dec 14 '11 at 20:46
  • Wow, +1 for HX DOS Extender, that's a sweet (and open source!) program I never heard of before. Dec 14 '11 at 22:54
  • Tried HX and it ran DigitalMarsC perfectly, although I haven't tried to compile anything yet. I also tried running a .NET executable with it and it told me that there were DLLs missing, so that could take some hacking to make work. Thanks for your answer! IMPORTANT NOTE: The HX-RT zip has a virus in it, so keep that in mind, all ye who read this post! Dec 15 '11 at 18:10
  • @StackUnderflow: Thanks for letting us know. I updated my post and emailed the program's author.
    – haimg
    Dec 15 '11 at 18:31
  • 3
    @Trav: The Windows 9x GUI was not a wrapper anymore; it only uses DOS as a bootloader, and to handle 16-bit drivers.
    – user1686
    Dec 15 '11 at 20:06
4

It depends on the Win32 program. Clearly, GUI programs cannot run for obvious reasons. Console applications on the other hand may be able to run.


In 1998 Chris Jones wrote a DOS program called WinEM (previously DOSCon) which attempts to emulate the Win32 API so that Windows console programs can be run under DOS. According to the manual, he had apparently intended to support GUI programs and even Direct-X games but had, as of version 1.00, implemented only basic DX and windowing functions (ie, only enough for “'hello, world'-in-a-window”).

I cannot find any newer versions, so I suspect that it turned out to be more difficult than he hoped and so he abandoned the project. Also, because the program was written during the time of Windows 98, it may (probably?) does not support later versions of Windows (2000+).

1
  • FYI WinEM 1.0 isn't able to run even the hello-world program built with OpenWatcom (owcc -bwin32 hello.c). The error message is: DosCon32 Error (2012): The entry point 'GetACP' was not found in the DLL 'KERNEL32.DLL'. winem.exe is 164776 bytes (seems to be compressed), it needs cwsdpmi.exe (21325 bytes).
    – pts
    Jul 17 '20 at 10:20
0

WDOSX can also run some command-line (console) Win32 programs, you need to run stubit prog.exe first (stubit.exe is part of WDOSX), and you need to copy the *.wdl files from the WDOSX distribution next to prog.exe.

Judging by the file sizes, it looks like HX supports more Win32 command-line functionality (i.e. more Win32 API calls) than WDOSX.

I had success with both WDOSX and HX recently: I compiled a C program with OpenWatcom V2 (using owcc -bwin32 prog.c), and the executable prog.exe ran fine on Windows and on DOS (both with WDOSX and HX).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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