DOS Network Utilities

If your PC is on a network or you are connected to the Internet, you can use a number of DOS Network utilities to check network connections, download files and communicate with other machines.

 

PING

PING sends a number of bytes(usually 32) to a specified machine in order to test the connection to that machine and to reveal the hostname or IP address. For example, pinging amazon.com would reveal their IP to be 208.216.182.15. You would do this by entering: PING AMAZON.COM at the DOS prompt. Now, to check put 208.216.182.15 in your browser's location windows and hit <--ENTER--> and see what happens.
 

TRACERT

To do the oposite of PING use TRACERT with the switch "-h" to reveal the number of "hops". Enter TRACERT -h 208.216.182.15 at the DOS prompt and hit <--ENTER-->. This will not only show that the hostname for 208.216.182.15 is AMAZON.COM, but will also show every single host that you are routed through to connect to AMAZON.COM.
 

TELNET

Typing TELNET at the DOS prompt will open a TELNET session, allowing you to emulate a termial connection with another computer. To learn more about TELNET click here.
 

FTP

FTP stands for File Transfer Protocol. FTP is an old, fast way to move data from one machine to another. To learn more about FTP click here.
FTP may be automated in batch files but requires a seperate login script file. The problem is that once DOS establishes an FTP connection, it's running in that shell and not the batch file. What we have to do is call another file, a kind of log-in script, once the FTP connection is established. This file should contain the username, password and FTP commands were going to issue. Our batch file would look like this:
 

@ECHO OFF
FTP -s:login host.com
CSL
EXIT
 

-s: is a switch that calls out login script, "login" would be the name of the script, but could be called by another name. The contents of the script may look like this:
 

username
password
GET pathname/filename.ext
DISCONNECT
QUIT
 

Just a simple list of commands that might be typed in an FTP session, preferably in a file that has no extension, that way no other programs attempt to open it when it is called by FTP. The first two should be your username and password for the FTP service, unless the FTP server permits anonymous connections. In this case the command line would have to have -A after the FTP.

NETSTAT

NETSTAT will tell you the current status of your network or internet connection. Entering NETSTAT at the DOS prompt by itself will reveal the main host you are connected to. Entering NETSTAT -A will reveal all the current TCP and UDP port activity on your PC.

INTERLNK

Got two crapy old PCs, can't afford to upgrade but you want to network them? In older versions of DOS INTERLNK allowed two machines to be connected through a parallel or serial cable.

INTERSVR

Starts the INTERLNK service, allows one machine to behave like a server.
 

The NET family of commands

All of these commands start with "NET" followed by a space and the second command word. NET by itself will display the definitions of the following second command words:

 

NET CONFIG Displays your current workgroup settings.
NET DIAG Runs the Microsoft Network Diagnostics program to display diagnostic information about your network.
NET HELP Provides information about commands and error messages.
NET INIT Loads protocol and network-adapter drivers without binding them to Protocol Manager.
NET LOGOFF Breaks the connection between your computer and the shared resources to which it is connected.
NET LOGON Identifies you as a member of a workgroup.
NET PASSWORD Changes your logon password.
NET PRINT Displays information about print queues and controls print jobs.
NET START Starts services.
NET STOP Stops services.
NET TIME Displays the time on or synchronizes your computer's clock with the clock on a Microsoft Windows for Workgroups, Windows NT, Windows 95, or NetWare time server.
NET USE Connects to or disconnects from a shared resource or displays information about connections.
NET VER Displays the type and version number of the workgroup redirector you are using.
NET VIEW Displays a list of computers that share resources or a list of shared resources on a specific computer.

These commands are useful for several reasons:
    1. You are running older, non-gui based network software
    2. You are running a hybrid network of Win machines and other boxes
    3. As the a client machine you may not have normal access to this information(especially useful if your netadmin is an idiot)
    4. You are running command-line batches or programs that need to run across the network and you don't have the time to write a full gui-app.
 

IPCONFIG

ipconfig [/? | /all | /release [adapter] | /renew [adapter] | /flushdns | /registerdns | /showclassid adapter | /setclassid adapter [classidtoset] ] adapter Full name or pattern with '*' and '?' to 'match', * matches any character, ? matches one character. Options /all Display full configuration information. /release Release the IP address for the specified adapter. /renew Renew the IP address for the specified adapter. /flushdns Purges the DNS Resolver cache. /registerdns Refreshes all DHCP leases and re-registers DNS names /displaydns Display the contents of the DNS Resolver Cache. /showclassid Displays all the dhcp class IDs allowed for adapter. /setclassid Modifies the dhcp class id. The default is to display only the IP address, subnet mask and default gateway for each adapter bound to TCP/IP. For Release and Renew, if no adapter name is specified, then the IP address leases for all adapters bound to TCP/IP will be released or renewed. For SetClassID, if no class id is specified, then the classid is removed. Examples: > ipconfig ... Show information. > ipconfig /all ... Show detailed information > ipconfig /renew ... renew all adapaters > ipconfig /renew EL* ... renew adapters named EL.... > ipconfig /release *ELINK?21* ... release all matching adapters, eg. ELINK-21, myELELINKi21adapter.




 

DOS PC/Hardware Utilities

DOS comes equipped with a number of very powerful utilities for analyzing and repairing harware problems. If your Graphic User Interface operating system will not open or boot, you may use these utilities to find and fix the problem.

 

SCANDISK

On older PCs this is called "CHKDSK". If you are in doubt about what version of DOS you are running or how old yor system is, type CHKDSK at the DOS prompt. any newer version of DOS will tell you that CHKDSK is no longer availble and to use SCANDISK instead. Enter SCANDISK C: and the program will open and begin checking your hard drive for physical damage and will also examine the file structure to find various errors. If the errors are not to serious, SCANDISK will fix them for you.
 

MEM

MEM will tell you how much memory(Random Operating Memory) you have and how much is being used. If you have a program or a process that needs a minimum amount of RAM, use MEM to check.
 

DEFRAG (Win '95, & Win '98)

Anytime you use SCANDISK, you should use DEFRAG right afterwards. DEFRAG defragments your hard drive, meaning it makes better use of the free space by putting all the used space together in an order that makes data access easier. It's a lot like cleaing up a cluttered closet. Enter DEFRAG C: at the DOS prompt and the program will open. Often, the program will allow you to view the process.
 

FDISK

Warning! This is very powerful tool and is usually used on new disks or disks that have been recycled. FDISK creates partitions on a hard drive. After you use FDISK, the drive should be formated or "SYSed".
Typing FDISK at the DOS prompt will bring you to s a new command-line dialog:
 

Current fixed disk drive: 1

Choose one of the following:

1. Create DOS partition or Logical DOS Drive
2. Set Active partition
3. Delete partition or Logical DOS Drive
4. Display partition information


Enter choice: [1]

Press ESC to exit FDISK
 

Be careful not to make any changes you don't want. Enter 4 to look at the present configuration. You may get something like this, but it depends on your own disk:
 

Partition Status Type Volume Label Mbytes System Usage
C: 1 A PRI DOS   7545 FAT32 79%

SYS

Places a copy of the operating system on the designated disk.
SYS C: A:, places the OS on C: onto the floppy disk in A:.

 

DBLSPACE.EXE (Win '95, & Win '98)

Compresses hard drives to double the space. This enlarges the drive space but does not optimize its use. This utility was more usefull in the days when storage space was expensive and hard to come by. 10 Gigabyte hard drives for $100 have made this utility obsolite.





 

Creating a Bootable DOS Floppy Disk


Anyone who has or works with a PC (any "IBM compatable", Windows system) should have a Boot Disk. I keep one in my bag. They are easy to make and come in handy quite often. Frankly, anyone who has a PC and doesn't have a boot disk is asking for trouble.

First of all, what is Booting?
Whenever a computer is turned on it goes through a number of complex procedures. If you have a fast computer, it will boot very quickly and you may not even notice what happens. If you have a slower computer, you may catch glimpses of what takes place when you power on. Early systems(and some newer, more complex ones) were booted manually. A computer operator(a human) had to perfrom the functions of bootting that we take for granted. The term comes from "pulling up oneself by the bootstraps," an expression in itself archaic. Most computers come with a BIOS chip. BIOS stands for Basic Input and Output System. BIOS is a low level operating system that allows computers to perform simple functions before more complex operating systems like Linux and Windows can be loaded. BIOS checks to see if you have enough power to run the system. BIOS tests your memory(RAM, SRAM, DRAM, Cache) by filling it with random data and then retreiving the data to see if matches the data put in(if there is a mismatch there may be bad memory chips, if there are no chips the system may not boot). BIOS tries to determine all the devices atatched: keyboard, mouse, disk drives, CDROM, hard-drive, modem, etc(if certain devices are not present, especially a keyboard there will be serious problems in booting). If BIOS finds a hard-drive(fixed drive) it tries to figure out what kind of operating system is loaded on the drive. If there is no operating system on the HD or BIOS can not determine what is on the HD, it will not boot to it.

When BIOS is happy with everything, it turns the show over to the operating system on the hard-drive. However, if your system does not boot, crashes when you boot or does not find an operating system a boot disk will be needed. The standard BIOS procedure is to check the floppy dirve for an operating system first(usually A:\) then it checks the hard-drive. If there is a floppy(removable disk) in the floppy drive with an operating system loaded, this will halt the BIOS process of booting to the hard-drive. If there is a floppy disk in the drive that is blank or has some other program on it, you will get a diskette error. If you are having trouble booting to your hard-drive you will need to interrupt the boot sequence to analyze the problem.

 

Making the disk


You will need:
A blank 3½ 1.44MB floppy disk
Access to a PC with DOS loaded

Windows 95/98/NT
Click the Start menu, select Programs, click "MS-DOS prompt".

Windows 3.1 & earlier
In the "Main" window click on the "MS-DOS Prompt" icon.

You should now have a DOS prompt.
Put your blank disk(Warning! Everything will be erased on the disk if it's not blank!) in the floppy drive, make sure the write protection is OFF(see the disk instructions on the box if you don't know how to do this).
At the C:\WINDOWS> or C:> prompt type FORMAT A:/S
This command will format the disk in the A:\ drive with a copy of the operating system. The switch /S specifies that the operating system should be added. FORMAT A: would just format this disk as a blank disk that files could be saved on.
Now, type in DIR A: at the DOS prompt or click on the floppy drive icon in "My Computer"
The following files should now be on the disk:

msdos.sys
scandisk.ini
sys.com
scandisk.exe
format.com
command.com
chkdsk.exe
attrib.exe
drivespace.bin
debug.exe
config.sys
himem.sys
edit.com
ebd.sys
fdisk.exe
regedit.exe
scanundo.dat
io.sys


They may not all be there or there may be more, depending on the DOS version. The most important files are io.sys, himem.sys, msdos.sys, command.com, sys.com, edit.exe, regedit.exe, and scandisk. With these programs you can work on a dead computer, as long as it has a working floppy drive. With the disk still in the drive, power down your PC and reboot it. The PC will now boot to the flopy disk with the A:\> as your prompt.
Take the disk out of the dive and turn the write-lock ON this will keep you from writing over this disk and also keep you from getting a virus in the boot sector of the disk where viruses often hide.