Science and technology

FreeDOS instructions it’s worthwhile to know

FreeDOS, the open supply implementation of DOS, supplies a light-weight working system for operating legacy functions on trendy hardware (or in an emulator) and for updating hardware vendor fails with a Linux-compatible firmware flasher. Getting accustomed to FreeDOS isn’t solely a enjoyable throwback to the computing days of the previous, it is an funding into gaining helpful computing expertise. In this text, I will take a look at a number of the important instructions it’s worthwhile to know to work on a FreeDOS system.

Essential listing and file instructions

FreeDOS makes use of directories to arrange recordsdata on a tough drive. That means it’s worthwhile to use listing instructions to create a construction to retailer your recordsdata and discover the recordsdata you have saved there. The instructions it’s worthwhile to handle your listing construction are comparatively few:

  • MD (or MKDIR) creates a brand new listing or subdirectory.
  • RD (or RMDIR) removes (or deletes) a listing or subdirectory.
  • CD (or CHDIR) modifications from the present working listing to a different listing.
  • DELTREE erases a listing, together with any recordsdata or subdirectories it incorporates.
  • DIR lists the contents of the present working listing.

Because working with directories is central to what FreeDOS does, all of those (besides DELTREE) are inside instructions contained inside COMMAND.COM. Therefore, they’re loaded into RAM and prepared to be used everytime you boot (even from a boot disk). The first three instructions have two variations: a two-letter brief identify and a protracted identify. There is not any distinction in follow, so I will use the brief type on this article.

Make a listing with MD

FreeDOS’s MD command creates a brand new listing or subdirectory. (Actually, for the reason that root is the primary listing, all directories are technically subdirectories, so I will seek advice from subdirectories in all examples.) An non-compulsory argument is the trail to the listing you need to create, but when no path is included, the subdirectory is created within the present working subdirectory.

For instance, to create a subdirectory referred to as letters in your present location:


This creates the subdirectory C:letters.

By together with a path, you’ll be able to create a subdirectory anyplace:


This has the identical outcome as transferring into C:HOMELETTERS first after which making a subdirectory there:


A path specification can’t exceed 63 characters, together with backslashes.

Remove a listing with RD

FreeDOS’s RD command removes a subdirectory. The subdirectory have to be empty. If it incorporates recordsdata or different subdirectories, you get an error message. This has an non-compulsory path argument with the identical syntax as MD.

You can’t take away your present working subdirectory. To try this, you have to CD to the mum or dad subdirectory after which take away the undesired subdirectory.

Delete recordsdata and directories with DELTREE

The RD command is usually a little complicated due to safeguards FreeDOS builds into the command. That you can not delete a subdirectory that has contents, as an example, is a security measure. DELTREE is the answer.

DELTREE deletes a complete subdirectory “tree” (a subdirectory), plus all the recordsdata it incorporates, plus all the subdirectories these comprise, and all the recordsdata they comprise, and so forth, multi functional simple command. Sometimes it may be a little bit too simple as a result of it might probably wipe out a lot information so shortly. It ignores file attributes, so you’ll be able to wipe out hidden, read-only, and system recordsdata with out realizing it.

You may even wipe out a number of timber by specifying them within the command. This would wipe out each of those subdirectories in a single command:


This is a type of instructions the place you actually should suppose twice earlier than you employ it. It has its place, positively. I can nonetheless keep in mind how tedious it was to enter every subdirectory, delete the person recordsdata, verify every subdirectory for contents, delete every subdirectory one after the other, then leap up one stage and repeat the method. DELTREE is a superb timesaver once you want it. But I might by no means use it for peculiar upkeep as a result of one false transfer can achieve this a lot harm.

Format a tough drive

The FORMAT command may also be used to organize a clean arduous drive to have recordsdata written to it. This codecs the D: drive:


Copy recordsdata

The COPY command, because the identify implies, copies recordsdata from one place to a different. The required arguments are the file to be copied and the trail and file to repeat it to. Switches embody:

  • /Y prevents a immediate when a file is being overwritten.
  • /-Y requires a immediate when a file is being overwritten.
  • /V verifies the contents of the copy.

This copies the file MYFILE.TXT from the working listing on C: to the foundation listing of the D: drive and renames it EXAMPLE.TXT:


This copies the file EXAMPLE.TXT from the working listing on C: to the C:DOCS listing after which verifies the contents of the file to make sure that the copy is full:


You may also use the COPY command to mix and append recordsdata. This combines the 2 recordsdata MYFILE1.TXT and MYFILE2.TXT and locations them in a brand new file referred to as MYFILE3.TXT:


Copy directories with XCOPY

The XCOPY command copies whole directories, together with all of their subdirectories and all the recordsdata contained in these subdirectories. Arguments are the recordsdata and path to be copied and the vacation spot to repeat them to. Important switches are:

  • /S copies all recordsdata within the present listing and any subdirectory inside it.
  • /E copies subdirectories, even when they’re empty. This choice have to be used with the /S choice.
  • /V verifies the copies that had been made.

This is a really highly effective and helpful command, notably for backing up directories or a complete arduous drive.

This command copies the complete contents of the listing C:DOCS, together with all subdirectories and their contents (besides empty subdirectories) and locations them on drive D: within the listing D:BACKUPDOCS:


Using FreeDOS

FreeDOS is a enjoyable, light-weight, open supply working system. It supplies a lot of nice utilities to allow you to get work accomplished on it, whether or not you are utilizing it to replace the firmware of your motherboard or to offer new life to an outdated pc. Learn the fundamentals of FreeDOS. You is likely to be shocked at how versatile it’s.

Some of the knowledge on this article was beforehand revealed in DOS lesson 8: Format; copy; diskcopy; XcopyDOS lesson 10: Directory commands (each CC BY-SA; and How to work with DOS.

Most Popular

To Top