Files with the extension .COM โ€” a relic of the era MS-DOS and earlier versions Windows, but are still found in archives of old apps, games or specialized software. On Android such files do not open out of the box: the system simply does not recognize the format intended for 16-bit processors x86. However, this does not mean that the launch is impossible.

The problem is that COM files contain executable code for the x86 architecture, while 99% of modern smartphones run on ARM processors. Direct execution of such code on Android will result in an incompatibility error. But there are workarounds: from emulation DOS to conversion to compatible formats. This article contains all the working methods, taking into account the limitations of the mobile OS, as well as critical security nuances, which are often silent.

What is a COM file and why does it not open on Android

Extension .COM (from English command) appeared in the 1980s to designate executable files in MS-DOS. Unlike modern EXE, COM files had strict restrictions:

  • ๐Ÿ“ Maximum size - 64 KB (including code and data).
  • ๐Ÿ–ฅ๏ธ Loaded into memory entirely and executed in one segment.
  • ๐Ÿ”„ Did not support modern mechanisms multitasking.

On Android such files do not run for three reasons:

  1. Processor architecture: ARM (smartphones) vs x86 (COM files).
  2. Lack of DOS environment: Android uses a kernel Linuxincompatible with DOS commands.
  3. Security: direct loading of executable code from unknown sources is blocked.
โš ๏ธ Warning: COM files often contain outdated code that is vulnerable to exploits. Running through emulators can open access to the system for malware if the file is downloaded from an unreliable source.

Method 1: DOS emulators for Android

The most reliable method is to use specialized emulators that create a virtual environment MS-DOS on a smartphone. The best options:

Emulator COM support Requirements Pros Cons
DOSBox Turbo โœ… Full Android 5.0+, 50 MB of memory Optimized for mobile, keyboard support Paid version for advanced features
aDOSBox โœ… Partial (depending on version) Android 4.1+, root access for full emulation Free, open source Complex setup, possible lags
Magic DOS โš ๏ธ Limited (simple files only) Android 6.0+, 100 MB of memory Simple interface, built-in games Does not support complex DOS commands

Instructions for DOSBox Turbo (recommended option):

  1. Download the emulator from Google Play.
  2. Place the COM file in the folder /sdcard/dosbox (create it manually if it is missing).
  3. Run DOSBox Turbo and enter the commands:
    mount c /sdcard/dosbox
    

    c:

    [file_name].com

Download the emulator|Create the dosbox folder on the memory card|Place the COM file in the folder|Run DOSBox and mount the disk-->

โš ๏ธ Attention: Some COM files require specific emulator settings (for example cycles=max for acceleration). Without them, the app may run too slowly or may not start at all.

Method 2: Converting COM to APK (for advanced users)

If emulation is not suitable, you can try converting the COM file to APK - a format native to Android. This method requires:

  • ๐Ÿ’ป A computer with Windows/Linux and installed Android Studio.
  • ๐Ÿ“‚ Tools apktool and dex2jar.
  • ๐Ÿ”ง Knowledge of the basics of building applications.

Conversion algorithm:

  1. Download DOSBox for Windows and check the functionality of the COM file on your PC.
  2. Use apktool for decompiling a template APK (for example, an empty project from Android Studio).
  3. Place the COM file in the folder assets of the decompiled APK.
  4. Edit AndroidManifest.xmlby adding permission to execute native code:
    <uses-permission android:name="android.permission.EXECUTE_NATIVE_CODE" />
  5. Rebuild the APK and sign it using jarsigner.

โš ๏ธ Critical Warning: This method is only suitable for simple COM files (for example, text utilities). Complex apps with graphics or network functions will most likely not work. In addition, Google Play prohibits publishing APKs with built-in executable files for other platforms - such a package will not pass moderation.

Why does conversion often fail?

COM files directly access hardware resources through DOS interrupts (INT 10h, INT 13h, etc.). On Android, these interrupts are not emulated, so apps that use them (for example, old games) simply crash with a segmentation fault.

Method 3: Remote access to a PC with DOS

If the COM file is critical, but does not run on the smartphone, an alternative is to connect to a remote PC with MS-DOS or Windows (in compatibility mode). To do this:

  1. Set up a remote access app on your PC: TeamViewer, AnyDesk or Chrome Remote Desktop.
  2. Install a DOS emulator on your PC (for example, DOSBox for Windows).
  3. From your phone, connect to the PC via remote access application.
  4. Run the COM file in the emulator on a PC, controlling the process from the smartphone screen.

Advantages of the method:

  • โœ… 100% compatibility (the file runs in its native environment).
  • โœ… No risk of damaging data on the phone.
  • โœ… Suitable for complex apps (for example, Turbo Pascal or DOS games).

Disadvantages:

  • โŒ Requires constant connection to PC.
  • โŒ Depends on the Internet speed (lag during control).
๐Ÿ’ก

For minimal lags, use Moonlight (for NVIDIA GPU) or Parsec โ€”these apps are optimized for streaming images from a PC.

Method 4: Online DOS emulators (with reservations)

There are web services that emulate MS-DOS directly in the browser (for example, JS-DOS or DosBox Online). COM file, but there are nuances:

  • ๐Ÿ”’ Security: Uploading files to third-party servers risks data leakage.
  • ๐Ÿšซ Limitations: Most services only support popular games (for example, Prince of Persia), but not arbitrary COM files.
  • ๐Ÿ“ถ Performance: emulation in the browser is slower than native applications.

If you still decide to try:

  1. Open the website in your smartphone browser https://js-dos.com.
  2. Click File โ†’ Upload and download COM file.
  3. Enter the file name in the console and click Enter.
โš ๏ธ Attention: Online emulators often block the execution of unknown files due to the risk of spreading viruses. If the COM file is not from an official source, the service may refuse to run it.

Method 5: Recompiling the source code (for developers)

If you have source code a app written for DOS, it can be adapted for Android using cross-compilation. You will need:

  • ๐Ÿ“ Sources in C, Pascal or Assembler.
  • ๐Ÿ› ๏ธ NDK (Native Development Kit) for Android.
  • ๐Ÿ”ง Knowledge of working with Makefile and CMake.

Example process:

  1. Install Android Studio and NDK.
  2. Create a new project with support native-code (option Include C++ support).
  3. Place the sources in a folder jni.
  4. Set up CMakeLists.txt to compile under ARM:
    cmake_minimum_required(VERSION 3.4.1)
    

    add_library(native-lib SHARED src/your_code.c)

    target_include_directories(native-lib PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

  5. Build the project - get an APK with the ported app.

โš ๏ธ Important: This method suitable only for apps that do not use specific DOS functions (for example, direct access to I/O ports). Games or utilities that directly work with hardware will require serious modification of the code.

DOS emulator on the phone|Remote access to a PC|Online emulator|Conversion to APK|I donโ€™t know, havenโ€™t tried it yet-->

Risks and precautions

Working with COM files on Android is associated with risks that are often ignored:

  • ๐Ÿฆ  Viruses: Old DOS apps are rarely scanned by antiviruses. For example, a virus Michelangelo (1992) may still be contained in archives.
  • ๐Ÿ”“ Vulnerabilities: DOS emulators may have flaws that allow the COM file code to escape the sandbox.
  • ๐Ÿ“ฑ Performance: Emulation x86 on ARM eats up to 30% of battery charge per hour.

How to minimize risks:

  1. Check the COM file by VirusTotal before downloading to your phone.
  2. Use emulators with an isolated environment (for example, DOSBox Turbo in mode --safe-mode).
  3. Disable the emulator's access to contacts, SMS and storage (in the Android permissions settings).
  4. Create a backup copy of your data before experiments.
๐Ÿ’ก

Never run COM files from unknown sources on a device with important data. It is better to use a sandbox - a separate smartphone or a virtual one. car.

FAQ: Frequently asked questions about COM files on Android

Is it possible to open a COM file without an emulator?

No. Android does not support direct loading of executable files for DOS. Even if you rename COM to EXE, the system does not recognize it. conversion to APK (see Method 2), but this does not work for all files.

Why does DOSBox give the "Illegal Command" error?

This error occurs if:

  • The file is damaged (check the MD5 checksum).
  • The emulator did not mount the folder with the file (the command mount c /sdcard/dosbox was executed incorrectly).
  • COM file requires specific launch parameters (for example, yourfile.com /param).

Solution: run the emulator with a log (dosbox -c "set debug=on") and study the errors.

How to run a game from the 90s (for example, Dune 2)?

For old games:

  1. Download the full version of the game (usually an archive with files .COM, .EXE and data).
  2. Use DOSBox Turbo with settings:
    cycles=max
    

    core=dynamic

    memsize=16

  3. To control, connect a Bluetooth keyboard or set up a touch interface in the emulator.

โš ๏ธ Games with copy protection (for example, Monkey Island) may not start without the original floppy disks.

Is it possible to run a COM file on Android without root access?

Yes, root access is only needed for some emulators (for example, aDOSBox in full emulation mode). DOSBox Turbo and online services work without root. However, without superuser rights you will not be able to:

  • Mount floppy disk images (.img files).
  • Emulate specific hardware (for example, Sound Blaster).
Where can I download secure COM files for tests?

Official sources:

โš ๏ธ Avoid torrent trackers and sites with "cracks" - they often contain modified files with viruses.