Today we're going to talk about Copying, Renaming, Creating Text Files, and displaying what is inside files when using DOS. These tutorials assume that a general knowledge of DOS is already known. The first tutorial and second tutorial are excellent resources when learning DOS.

### Diskcopy

Diskcopy is a command that allows us to copy the contents from one floppy disk to another. This can be useful to create backups of the contents on a floppy disk. This can be useful in easily backing up content on a floppy that contains old finical records and other important documents from the golden days of 3.5" floppy disks.

C:\> diskcopy a:
This would make a copy of the disk that is currently in the a: (default floppy) drive. You should not use diskcopy for anything other than floppy drives, however.

### Rename or Ren

Rename or Ren allows us to rename files and folders. Let us start by navigating to our directory that we want to test our files in. The default directory for vista and XP will suffice for this example.

 Vista/7 C:\Users\Dennis>mkdir test

 

XP C:\Documents and Settings\Dennis>mkdir test 

The mkdir command creates a new directory in the current directory that we're in so no need to put the entire path to the new directory.

The syntax for the ren/rename is a little strange and nothing like any command previously mention before in this series. Be sure the path points to the parent directory (one level above the test directory), otherwise an error will occur. The syntax is the following:

 ren [drive]

path]

!current name] [new name] 

Example: ren C:\users\dennis\test test2 

To verify the name change actually occurred, use the dir command to view the contents of the directory.

### Edit

The edit command is a very basic text editor in DOS. This allows us to type basic .txt files without word wrap, without spell checker, without any configuration whatsoever.

There are two flavors of the edit command. There is the default blue background\white text option and then we can add a switch that makes the window and text the same as the default DOS window (black background and a light-gray text).

In order to activate the edit window, all we need to do is simply type "edit".

C:\users\dennis\test> edit

Type a few lines of text and then press file and save as.

Once the file is saved (be sure to include the file extension ".txt"), double check to make sure the file was successfully created by using the dir command.

### Type

The type command allows us to view any files created using the edit command regardless of file extension. Files encoded with Microsoft Office such as .doc or .docx cannot be viewed using the type command. The syntax of the type command is as follows:

 [Drive:]!path]\type [filename.file extension] C:\users\dennis\test>type dosstuff.txt 

Notice that we are able to view any file extension as long as it was encoded using the edit command in DOS. If we were to view a file encoded in Microsoft Office 2007 it would look like the following:

Notice the arbitrary characters that occur when we try to view documents encoded using MS Word. This is because the encoding format is something that DOS cannot read.

Be Sociable, Share!