Export (0) Print
Expand All

Replace

Archived content. No warranty is made as to technical accuracy. Content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Replaces files in a destination directory with files in a source directory that have the same name. You can also use replace to add unique filenames to the destination directory.

On This Page

Syntax
Restore
Rmdir (rd)
Set
Setver
SETVER.EXE
Share
Shell
Shift
SIZER.EXE
Smartdrv
SMARTDRV.EXE — Double Buffering

Syntax

replace [drive1:][path1]filename [drive2:][path2] [/a] [/p] [/r] [/w]

replace [drive1:][path1]filename [drive2:][path2] [/p] [/r] [/s] [/w] [/u]

Parameters

[ drive1: ][ path1 ] filename

Specifies the location and name of the source file or set of files.

[ drive2: ][ path2 ]

Specifies the location of the destination file. You cannot specify a filename for files you replace. If you specify neither a drive nor a directory, replace uses the current drive and directory as the destination.

Switches

/a

Adds new files to the destination directory instead of replacing existing files. You cannot use this switch with the /s or /u switch.

/p

Prompts you for confirmation before replacing a destination file or adding a source file.

/r

Replaces read-only files as well as unprotected files. If you do not specify this switch but attempt to replace a read-only file, an error results and stops the replacement operation.

/s

Searches all subdirectories of the destination directory and replaces matching files. You cannot use the /s switch with the /a switch. The replace command does not search subdirectories specified in path1.

/w

Waits for you to insert a disk before replace begins to search for source files. If you do not specify /w, replace begins replacing or adding files immediately after you press ENTER.

/u

Replaces (updates) only those files on the destination directory that are older than those in the source directory. You cannot use the /u switch with the /a switch.

Notes

Replace messages

As replace adds or replaces files, MS-DOS displays their filenames on the screen. After the replace command is finished, MS-DOS displays a summary line in one of the following formats:

nnn files added
nnn files replaced
no file added
no file replaced

Replacing files on a floppy disk system

If you have a floppy disk system and need to switch disks during the replace operation, you can specify the /w switch so that replace will wait for you to switch disks, as necessary.

Limitations on replace

You cannot use the replace command to update hidden files or system files such as IO.SYS and MSDOS.SYS. For information about changing hidden and system attributes, see the attrib command.

Replace exit codes

The following list shows each exit code and a brief description of its meaning:

0 Replace successfully replaced or added the files. 1

The computer has a version of MS-DOS that is incompatible with replace.

2 Replace could not find the source files. 3Replace could not find the source or destination path. 5

The user does not have access to the files you want to replace.

8

There is insufficient system memory to carry out the command.

11

The user used the wrong syntax on the command line.

You can use the errorlevel parameter on the if command line in a batch program to process exit codes returned by replace.

For an example of a batch program that processes exit codes, see the if command.

Examples

Suppose that several directories on drive C contain different versions of a file named PHONES.CLI, which contains client names and phone numbers. To replace all of these files with the latest version of the PHONES.CLI file from the disk in drive A, type the following command:

replace a:\phones.cli c:\ /s 

Suppose you want to add new printer device drivers to a directory on drive C named TOOLS, which already contains several printer device-driver files for a word processor. To do this, type the following command:

replace a:*.prd c:\tools /a 

This command searches the current directory on drive A for any files that have the extension .PRD and then adds these files to the TOOLS directory on drive C. Because the /a switch is included, replace adds only those files from drive A that do not exist on drive C.

Related Command

For information about changing file attributes, see the attrib command.

Restore

Restores files that were backed up by using any version of backup from MS-DOS versions 2.0 through 5.0. If you are restoring files that were backed up using the msbackup command in MS-DOS 6, use the msbackup program to restore files.

You can restore files from similar or dissimilar disk types.

Syntax

restore drive1: drive2:[path[filename]] [/s] [/p] [/b:date] [/a:date] [/e:time] [/l:time] [/m] [/n] [/d]

Parameters

drive1:

Specifies the drive on which the backed-up files are stored.

drive2:

Specifies the drive to which the backed-up files will be restored.

path

Specifies the directory to which the backed-up files will be restored. You must specify the same directory from which the files were backed up.

filename

Specifies the names of the backed-up files you want to restore.

Switches

/s

Restores all subdirectories.

/p

Prompts you for permission to restore files that are read-only (that have the read-only attribute set) or that have changed since the last backup (that have the archive attribute set).

/b: date

Restores only those files last modified on or before the specified date. The format of date varies according to the country setting in your CONFIG.SYS file. For information about specifying date, see the date command.

/a: date

Restores only those files last modified on or after the specified date. The format of date varies according to the country setting in your CONFIG.SYS file. For information about specifying date, see the date command.

/e: time

Restores only those files last modified at or earlier than the specified time. The format of time varies according to the country setting in your CONFIG.SYS file. For information about specifying time, see the time command.

/l: time

Restores only those files last modified at or later than the specified time. The format of time varies according to the country setting in your CONFIG.SYS file. For information about specifying time, see the time command.

/m

Restores only those files modified since the last backup.

/n

Restores only those files that no longer exist on the destination disk.

/d

Displays a list of the files on the backup disk that match the names specified in filename without restoring any files. Even though no files are being restored, you must specify drive2 when you use /d.

Notes

Checking restored files

Once a file has been restored, you can use the dir or type command to make sure the file was restored properly.

Limitations on restore

You cannot use the restore command to restore system files (IO.SYS and MSDOS.SYS). Restore does not work with drives that have been redirected with the assign or join command.

Compatibility with previous versions of backup

The MS-DOS 6 restore command can restore files that were backed up by using the backup command in MS-DOS versions 2.0 through 5.0.

Restore exit codes

The following list shows each exit code and a brief description of its meaning:

0

Restore successfully restored the file or files.

1

Restore could not find the files to restore.

3

The user pressed CTRL+C to stop the restoring operation.

4

Restore stopped because of an error.

You can use the errorlevel parameter on the if command line in a batch program to process exit codes returned by restore.

For an example of a batch program that processes exit codes, see the if command.

Listing the names of backed-up files

Use the /d switch to see a list of the backed up files. If you specify filename with the /d switch, restore displays a list of the backed up files that match the name you specify. If you use the /d switch, restore does not restore any files.

Restoring to different drives

While you must restore files to their original directory, you can restore them to a different drive. For example, files backed up from the C:\MYFILES\*.* directory can be restored to the D:\MYFILES\*.* directory.

Examples

To restore the file INVEST.MNT from the backup disk in drive A to the IRS directory on drive C, type the following command:

restore a: c:\irs\invest.mnt 

MS-DOS prompts you to insert the backup disk into drive A. Once the backup disk is in drive A, press ENTER to continue.

Suppose you backed up all of the files in the directory \USER\ADAMS on drive C. To restore these files, insert the backup disk in drive A and type the following command:

restore a: c:\user\adams\*.* 

It is important that you specify *.* for filename. Otherwise, the restore command attempts to restore a file named ADAMS in the USER directory.

To restore a complete hard disk from a backup disk (or disks) in drive A, type the following command:

restore a: c:\*.* /s 

The /s switch and the wildcards (*.*) specify that restore is to restore all backed-up files to their original directories and subdirectories on drive C.

Related Command

For information about backing up files, see the msbackup command.

Rmdir (rd)

Deletes (removes) a directory.

Before you can delete a directory, you must delete its files and subdirectories. The directory must be empty except for the "." and ".." symbols.

Syntax

rmdir [drive:]path

rd [drive:]path

Parameters

[ drive: ] path

Specifies the location and name of the directory you want to delete.

Notes

Cannot delete directory with hidden or system files

You cannot delete a directory that contains files, including hidden or system files. If you attempt to do so, MS-DOS displays the following message:

Invalid path, not directory,
or directory not empty

Use the dir command to list hidden and system files and the attrib command to remove hidden and system attributes from files. For more information, see those commands.

Using the backslash character with the path parameter

If you insert a backslash (\) before the first directory name in path, MS-DOS treats the directory as a subdirectory of the root directory — regardless of your current directory. If you do not insert a backslash before the first directory name in path, MS-DOS treats the directory as a subdirectory of the current directory.

Deleting the current directory

You cannot use rmdir to delete the current directory. You must first change to a different directory (not a subdirectory of the current directory) and then use rmdir with a path. If you attempt to delete the current directory, MS-DOS displays a message in the following format:

Attempt to remove current directory - drive:path

MS-DOS also displays this message if you attempt to delete a directory that has been redirected by using the subst command.

Example

To delete a directory named \USER\SMITH, first ensure that the directory is empty, as in the following example:

dir \user\smith /a 

MS-DOS should display only the "." and ".." symbols.

Then, from any directory except \USER\SMITH, type the following command:

rmdir \user\smith 

You can type the following command with the same result:

rd \user\smith 

Related Commands

For information about creating a directory, see the mkdir command.

For information about hidden files, see the attrib command and the dir command (the /a switch).

For information about deleting files, see the del command.

For information about deleting a directory, its files, and all subdirectories and files subordinate to it, see the deltree command.

Set

Displays, sets, or removes MS-DOS environment variables.

You use environment variables to control the behavior of some batch files and programs and to control the way MS-DOS appears and works. The set command is often used in the AUTOEXEC.BAT or CONFIG.SYS files to set environment variables each time you start MS-DOS.

Syntax

set [variable=[string]]

To display the current environment settings, use the following syntax:

set

Parameters

variable

Specifies the variable you want to set or modify.

string

Specifies the string you want to associate with the specified variable.

Notes

Displaying the current environment settings

When you type the set command alone, MS-DOS displays the current environment settings. These settings usually include the COMSPEC and PATH environment variables that MS-DOS uses to help find programs on disk. PROMPT and DIRCMD are two other environment variables that MS-DOS uses. For more information about DIRCMD, see the dir command.

Using parameters

When you use a set command and specify values for both variable and string, MS-DOS adds the specified variable value to the environment and associates the string with that variable. If the variable already exists in the environment, the new string value replaces the old string value.

If you specify only a variable and an equal sign (without a string) for the set command, MS-DOS clears the string value associated with the variable (as if the variable is not there at all).

Using set in batch files

When creating batch files, you can use the set command to create variables and use them in the same way as you would the numbered variables %0 through %9. You can also use the variables %0 through %9 as input for the set command.

Calling a set variable from a batch file

When you call a variable value from a batch file, you must enclose the value with percent signs (%). For example, if your batch program creates an environment variable named BAUD, you can use the string associated with BAUD as a replaceable parameter by inserting %baud% on the command line.

Effect of set on environment space

After you use a set command, MS-DOS might display the following message:

Out of environment space

This message means the available environment space is insufficient to hold the new variable definition. For information about how to increase the environment space, see the command command.

Examples

To set an environment variable named INCLUDE so that the string C:\INC (the INC directory on drive C) is associated with it, type the following command:

set include=c:\inc 

You can then use the string C:\INC in batch files by enclosing the name INCLUDE with percent signs (%). For example, you might include the following command in a batch file in order to display the contents of the directory associated with the INCLUDE environment variable:

dir %include% 

When MS-DOS processes this command, the string C:\INC replaces %include%.

Another possible use for the set command is in a batch program that adds a new directory to the PATH environment variable, as the following example shows:

@echo off
rem ADDPATH.BAT adds a new directory
rem to the PATH environment variable.
set path=%1;%path%
set

Related Commands

For information about setting environment variables that MS-DOS uses to control its own operations, see the path, prompt, shell, and dir commands.

Setver

Displays the version table. Reports a version number (earlier than 6.0) to programs or device drivers that were designed for earlier versions of MS-DOS.

You can also use this command to display and modify the version table, which lists names of programs and the number of the MS-DOS version with which they are designed to run. If you are using a program that has not been updated for MS-DOS 6, you can add its name to the version table by using the setver command.

Syntax

setver [drive:path][filenamen.nn]

setver [drive:path][filename [/delete [/quiet]]

To display the current version table, use the following syntax:

setver [drive:path]

MS-DOS displays two columns: the left column lists the names of the program files; the right column lists the corresponding MS-DOS version with which each file is set to run.

Parameters

[ drive:path ]

Specifies the location of the SETVER.EXE file.

filename

Specifies the name of the program file (usually an .EXE or .COM file) that you want to add to the version table. You cannot use a wildcard character (* or ?).

n.nn

Specifies the MS-DOS version (for example, 3.3 or 4.01) that MS-DOS 6 reports to the specified program file.

Switches

/delete

Deletes the version-table entry for the specified program file. You can abbreviate this switch as /d.

/quiet

Hides the message typically displayed during deletion of an entry from the version table.

Notes

Setver confirmation

If you make changes to the version table and no errors are detected, MS-DOS displays the following message:

WARNING - Contact your software vendor for information about whether a specific 
program works with MS-DOS 6. It is possible that Microsoft has not verified 
whether the program will successfully run if you use the SETVER command to change
 the program version number and version table. If you run the program after
  changing the version table in MS-DOS 6, you may lose or corrupt data or introduce
   system instabilities. Microsoft is not responsible for any loss or damage, or for 
   lost or corrupted data.
Version table successfully updated
The version change will take effect the next time you restart your system.

Loading the version table into memory

Before you can use the setver command, the version table must be loaded into memory by a device command in your CONFIG.SYS file. By default, the MS-DOS Setup program modifies your CONFIG.SYS file to ensure that the version table is loaded into memory each time you start your system.

Setting the version number of a command interpreter

You can use setver to set the version number of a command interpreter; however, if you set the version number of the MS-DOS 6 command interpreter (COMMAND.COM), you may not be able to start your system.

Using the version table

Many programs designed to run with a previous version of MS-DOS will run correctly with MS-DOS 6. In some cases, however, a program might not run correctly unless its name is included in the version table. The table indicates to the program that it is running with the MS-DOS version for which it was designed, even though it is running with MS-DOS 6. By interpreting MS-DOS 6 as the earlier version, the program will probably run correctly; however, using setver will not solve the problem if the program is not compatible with MS-DOS 6.

Restarting after updating the version table

When you update the version table by adding or deleting entries, you must restart your system before the changes will take effect.

Updating existing entries

If you specify a filename that is already in the version table, the new entry replaces the existing entry.

Setver exit codes

The following list shows each exit code and a brief description of its meaning:

0

Setver successfully completed its task.

1

The user specified an invalid command switch.

2

The user specified an invalid filename.

3

There is insufficient system memory to carry out the command.

4

The user specified an invalid version-number format.

5

Setver could not find the specified entry in the version table.

6

Setver could not find the SETVER.EXE file.

7

The user specified an invalid drive.

8

The user specified too many command-line parameters.

9

Setver detected missing command-line parameters.

10

Setver detected an error while reading the SETVER.EXE file.

11

The SETVER.EXE file is corrupt.

12

The specified SETVER.EXE file does not support a version table.

13

There is insufficient space in the version table for a new entry.

14

Setver detected an error while writing to the SETVER.EXE file.

You can use the errorlevel parameter on the if command line in a batch program to process exit codes returned by setver. For an example of a batch program that processes exit codes, see the if command.

Examples

Suppose you have a program file named MYPROG.EXE that runs with MS-DOS version 3.30. To run MYPROG.EXE, you must first use the setver command to create an entry in the version table that will cause MYPROG.EXE to interpret MS-DOS 6 as version 3.30:

setver myprog.exe 3.30 

To delete the MYPROG.EXE entry from the version table (without otherwise affecting the MYPROG.EXE file), type the following command:

setver myprog.exe /delete 

To list the contents of the version table on drive C, type the following command:

setver c: 

Related Command

For information about loading the version table into MS-DOS, see the SETVER.EXE command.

SETVER.EXE

Loads the MS-DOS version table into memory. This device driver must be loaded by a device or devicehigh command in your CONFIG.SYS file.

SETVER.EXE loads into memory the MS-DOS version table, which lists names of programs and the number of the MS-DOS version with which each program is designed to run.

Syntax

device=[drive:][path]setver.exe

Parameters

[ drive: ][ path ]

Specifies the location of the SETVER.EXE file.

Note

If you are using setver to report a different MS-DOS version for a device driver, the device command loading SETVER.EXE must appear in your CONFIG.SYS file before the device command loading the other device driver.

Share

Starts the Share program, which installs file-sharing and locking capabilities on your disks and network drives.

Syntax

share [/f:space] [/l:locks]

In your CONFIG.SYS file, use the following syntax:

install=[[drive:]path]share.exe [/f:space] [/l:locks]

Parameters

[ drive: ] path

Specifies the location of the SHARE.EXE file.

Switches

/f: space

Allocates file space (in bytes) for the MS-DOS storage area used to record file-sharing information. The default value is 2048.

/l: locks

Sets the number of files that can be locked at one time. The default value is 20.

Notes

Common use of Share

Typically, you use the share command in a network or multitasking environment in which programs share files. Share loads the code that supports file-sharing and locking in these environments. Once you install Share, MS-DOS uses the code loaded by Share to validate all read and write requests from programs. For example, if two people are accessing the same data file, Share manages the file so both people do not write to the file at the same time.

Allocating space for file-sharing information

When deciding how many bytes to allocate for file sharing, note that each open file requires enough space for the length of the full path and filename. The average length of a filename and its path is 20 bytes.

Using Share with Microsoft Flash File System

Share may be required in order to run some applications with Microsoft Flash File System.

Examples

The following example shows how you can use the install command in your CONFIG.SYS file to load Share, with the default values for the /f and /l switches. MS-DOS searches for the file SHARE.EXE in the DOS directory on drive C.

install=c:\dos\share.exe 

The following example allocates 4096 bytes for storing file-sharing information and specifies that 25 files can be locked at one time. Again, MS-DOS searches for SHARE.EXE in the DOS directory on drive C:

install=c:\dos\share.exe /f:4096 /l:25 

Shell

Specifies the name and location of the command interpreter you want MS-DOS to use. You can use this command only in your CONFIG.SYS file.

If you want to use your own command interpreter (instead of COMMAND.COM), you can specify its name by adding a shell command to your CONFIG.SYS file.

Syntax

shell=[[drive:]path]filename [parameters]

Parameters

[[ drive: ] path ] filename

Specifies the location and name of the command interpreter you want MS-DOS to use.

parameters

Specifies any command-line parameters or switches that can be used with the specified command interpreter.

Notes

Default setting

The default command interpreter for MS-DOS is COMMAND.COM. If you do not use a shell command in your CONFIG.SYS file, MS-DOS searches for COMMAND.COM in the root directory of your startup drive. You need to use the shell command if you want to specify a COMMAND.COM file that is not in the root directory or if you do not want to use the default environment size for COMMAND.COM. For information about COMMAND.COM switches, see the command command.

Using switches with a command interpreter

The shell command itself does not accept any switches, but if the command interpreter does, you can include them on the shell command line.

Examples

Suppose the file NEWSHELL.COM is in a directory named BIN on your startup drive, and suppose you want to use NEWSHELL.COM as your command interpreter. To do this, add the following command to your CONFIG.SYS file:

shell=\bin\newshell.com 

Suppose you add the line shell=NEWCMDP.COM to your CONFIG.SYS file, and suppose the NEWCMDP.COM command interpreter accepts the switches /c, /p, and /e. You can now use any of these switches on the shell command line. Thus, the following command would be valid:

shell=newcmdp.com /c /p /e 

The shell command is the preferred method of using command to increase the size of the environment. To increase the environment size to 512 bytes, add the following command to your CONFIG.SYS file:

shell=command.com /e:512 /p 

To start an MS-DOS command interpreter located in the directory OLD on drive C, add the following command to your CONFIG.SYS file:

shell=c:\old\command.com c:\old /e:256 /p 

Related Command

For information about COMMAND.COM switches, see the command command.

Shift

Changes the position of replaceable parameters in a batch program.

Syntax

shift

Notes

How the shift command works

The shift command changes the values of the replaceable parameters %0 through %9 by copying each parameter into the previous one. In other words, the value of %1 is copied to %0, the value of %2 is copied to %1, and so on. This is useful for writing a batch file that performs the same operation on any number of parameters.

Working with more than 10 command-line parameters

You can also use the shift command to create a batch file that can accept more than 10 parameters. If you specify more than 10 parameters on the command line, those that appear after the tenth (%9) will be shifted one at a time into %9.

Shifting parameters back

There is no backward shift command. Once you carry out the shift command, you cannot recover the first parameter (%0) that existed before the shift.

Example

The following batch file, MYCOPY.BAT, shows how to use the shift command with any number of parameters. It copies a list of files to a specific directory. The parameters are the directory name followed by any number of filenames.

@echo off
rem MYCOPY.BAT copies any number of files
rem to a directory.
rem The command uses the following syntax:
rem mycopy dir file1 file2 ...
set todir=%1
:getfile
shift
if "%1"=="" goto end
copy %1 %todir%
goto getfile
:end
set todir=
echo All done

SIZER.EXE

Used by the MemMaker memory-optimization program to determine the size in memory of device drivers and memory-resident programs.

During optimization, MemMaker adds SIZER.EXE to the beginning of each CONFIG.SYS or AUTOEXEC.BAT command that starts a driver or program. When the optimization process is complete, MemMaker removes SIZER.EXE from each command line.

This program is used exclusively by MemMaker.

Smartdrv

Starts or configures SMARTDrive, which creates a disk cache in extended memory. A disk cache can significantly speed up MS-DOS disk operations. When used for disk caching, SMARTDrive is loaded by using the smartdrv command in your AUTOEXEC.BAT file or at the command prompt.

SMARTDrive can also perform double buffering, which provides compatibility for hard-disk controllers that cannot work with memory provided by EMM386 or Windows running in 386 enhanced mode. To use double buffering, load the SMARTDRV.EXE device driver by using a device command in your CONFIG.SYS file.

The smartdrv command should not be used after Windows has started.

Syntax

When starting SMARTDrive from your AUTOEXEC.BAT file or from the command prompt, use the following syntax:

[drive:][path]smartdrv [[drive[+|-]]...] [/e:ElementSize] [InitCacheSize][WinCacheSize]] [/b:<BufferSize>] [/c] [/r] [/l] [/q] [/v] [/s]

Once SMARTDrive is running, use the following syntax:

smartdrv [[drive[+|-]]...]] [/c] [/r]

Parameters

[ drive: ][ path ]

Specifies the location of the SMARTDRV.EXE file.

[[ drive +|-]

Specifies the letter of the disk drive for which you want to control caching. Include the plus (+) sign to enable caching for the specified drive; include the minus (-) sign to disable caching for that drive. You can specify multiple disk drives.

If you specify a drive letter without a plus or minus sign, read-caching is enabled and write-caching is disabled. If you specify a drive letter followed by a plus sign (+), read-caching and write-caching are enabled. If you specify a drive letter followed by a minus sign (-), both read-caching and write-caching are disabled. If you don't specify a drive letter, floppy disk drives and drives created using Interlnk are read-cached but not write-cached, hard disk drives are both read-cached and write-cached, and CD-ROM, network drives and Microsoft Flash memory-card drives are ignored. (For information about how DoubleSpace caches compressed drives, see Notes.)

/e: ElementSize

Specifies in bytes the amount of the cache that SMARTDrive moves at a time. Valid values are 1024, 2048, 4096, and 8192. The default value is 8192. The larger the value, the more conventional memory SMARTDrive uses.

InitCacheSize

Specifies the size in kilobytes of the cache when SMARTDrive starts (when Windows is not running). The size of the disk cache affects how efficiently SMARTDrive runs. In general, the larger the cache, the less often SMARTDrive needs to read information from the disk, which speeds up your system's performance. If you do not specify an InitCacheSize value, SMARTDrive sets the value according to how much memory your system has (see the table below this list).

WinCacheSize

Specifies, in kilobytes, how much SMARTDrive will reduce the cache size for Windows. When you start Windows, SMARTDrive reduces the size of the cache to recover memory for Windows' use. When you quit Windows, the cache returns to its normal size. WinCacheSize specifies the smallest size to which SMARTDrive will deduce the cache. The default value depends on how much available memory your system has (see the table below this list). If you specify a value for InitCacheSize that is smaller than the value specified for WinCacheSize, InitCacheSize is set to the same size as WinCacheSize.

/b: BufferSize

Specifies the size of the read-ahead buffer. A read-ahead buffer is additional information that SMARTDrive reads when an application reads information from the hard disk. For example, if an application reads 512K of information from a file, SMARTDrive then reads the amount of information specified by BufferSize and saves it in memory. The next time the application needs to read information from that file, it can read it from memory instead. The default size of the read-ahead buffer is 16K. Its value can be any multiple of ElementSize. The larger the value of BufferSize, the more conventional memory SMARTDrive uses.

/c

Writes all cached information from memory to cached disks. SMARTDrive writes information from memory to the disk at times when other disk activity has slowed. You might use this option if you are going to turn off your computer and want to make sure all cached information has been written to the disk. (SMARTDrive writes all cached information to the disk if you restart your computer by pressing CTRL+ALT+DELETE, but not if you simply turn off the power or press your computer's reset button.)

/r

Clears the contents of the existing cache and restarts SMARTDrive.

/l

Prevents SMARTDrive from automatically loading into upper memory blocks (UMBs), even if there are UMBs available. You can use the /l switch if upper memory is enabled for use by programs. If you are using SMARTDrive's double-buffering feature and your system appears to be running slowly, try adding the /l switch to the SMARTDrive command in your AUTOEXEC.BAT file.

/q

Instructs SMARTDrive not to display status messages when it starts. (By default, SMARTDrive does not display status messages.) If SMARTDrive encounters an error while starting, it displays an error message whether or not it was loaded with the /q switch. The /q switch cannot be used in conjunction with the /v switch.

/v

Instructs SMARTDrive to display status and error messages when it starts. (By default, SMARTDrive does not display any messages unless it encounters an error condition.) The /v switch cannot be used in conjunction with the /q switch.

/s

Displays additional information about the status of SMARTDrive.

The following table shows what the default values for InitCacheSize and WinCacheSize will be, depending on the amount of available extended memory your computer has.

Extended Memory

InitCacheSize

WinCacheSize

Up to 1 MB

All extended memory

Zero (no caching)

Up to 2 MB

1 MB

256K

Up to 4 MB

1 MB

512K

Up to 6 MB

2 MB

1 MB

6 MB or more

2 MB

2 MB

Caution: Check that SMARTDrive has completed all write-caching before you restart or turn off your computer. (This is not necessary if you restart your computer by pressing CTRL+ALT+DELETE.) To have SMARTDrive write all cached information to cached disks, type smartdrv /c at the command prompt. After all disk activity has stopped, you can safely restart or turn off your computer.

Notes

Using extended memory

For SMARTDrive to use extended memory, your CONFIG.SYS file must contain a device command for HIMEM.SYS or another extended-memory manager that conforms to the Lotus/Intel/Microsoft/AST eXtended Memory Specification (XMS).

Loading SMARTDrive into the upper memory area

If the upper memory area is available through MS-DOS, SMARTDrive will automatically load into upper memory. You do not need to use the loadhigh command with SMARTDrive.

SMARTDrive and Compressed Drives

SMARTDrive does not actually cache compressed drives; instead, it caches the physical drive on which the compressed volume file is located. This improves the speed of both the physical drive and the compressed drive.

Examples

To create a SMARTDrive disk cache with a cache size of 256K (the default size), add the following command to your AUTOEXEC.BAT file:

c:\dos\smartdrv 

A typical SMARTDrive command

Suppose you want to create a disk cache with a cache size of 2048K, and ensure that programs cannot reduce the size of the cache to less than 1024K. To do this and to specify that the SMARTDRV.EXE file is located in the DOS directory on drive C, add the following line to your AUTOEXEC.BAT file:

c:\dos\smartdrv 2048 1024 

Enabling and disabling caching on specific drives

Suppose you want to disable all caching of your floppy-disk drives and enable write caching on Interlnk drive D. (Interlnk drives, like floppy-disk drives, are not write-cached because it's possible to lose access to the drive before all information has been written from the cache). To do this, you would add the following command to your AUTOEXEC.BAT:

c:\dos\smartdrv a- b- d+ 

Saving cached information on the hard disk

Before pressing your computer's reset button or turning off your computer, it is a good idea to have SMARTDrive write all cached information from memory to any cached disks. To do this, type the following at the command prompt:

smartdrv /c 

You will not need to use this command before restarting your computer by pressing the CTRL+ALT+DELETE keys: SMARTDrive detects the CTRL+ALT+DELETE key sequence and automatically writes all information to cached disks before allowing the system to restart.

SMARTDRV.EXE — Double Buffering

Loads the SMARTDRV.EXE device driver to perform double buffering. Double buffering provides compatibility for certain hard-disk controllers that cannot work with memory provided by EMM386 or Windows running in 386 enhanced mode. To find out whether you need SMARTDrive, see Notes.

SMARTDrive can also perform disk caching, which can speed up your computer. To use SMARTDrive for disk caching, add the smartdrv command to your AUTOEXEC.BAT file.

To use the double-buffering feature of SMARTDrive, the SMARTDRV.EXE device driver must be loaded by a device command in your CONFIG.SYS file.

Syntax

device=[drive:][path]smartdrv.exe /double_buffer

Parameters

[ drive: ][ path ]

Specifies the location of the SMARTDRV.EXE file.

/double_buffer

Instructs SMARTDrive to perform double buffering.

Notes

Double buffering and conventional memory

SMARTDrive's double-buffering component must be loaded in conventional memory. It uses 2K of conventional memory, and cannot be loaded in upper memory.

The SMARTDrive disk cache can use either upper memory or conventional

Determining whether you need to use double buffering

If you use EMM386 or run Windows in 386 enhanced mode, you may need to use double buffering. Double buffering is most commonly required with an SCSI (small computer system interface) hard disk or other device, but can also be necessary with an ESDI (enhanced system device interface) or MCA (microchannel architecture) device.

Most hard disks do not need to use double buffering. If you are not sure whether your hard disk needs double buffering, follow these steps:

  1. Add the following command to your CONFIG.SYS file if the file does not already contain such a command:

    device=c:\dos\smartdrv.exe /double_buffer
    
  2. Add the following command to your AUTOEXEC.BAT file if the file does not already contain such a command:

    c:\dos\smartdrv
    
  3. Run the MemMaker program if you haven't already done so.

  4. Use the mem /c /p command to confirm that upper memory is in use.

  5. At the command prompt, type smartdrv and then press ENTER.

  6. SMARTDrive displays information about your system.

  7. Look at the column labeled "Buffering." If any line in this column reads "yes," you need to run the double-buffering component of SMARTDrive. (If your system seems to be running slowly, try adding the /l switch to the smartdrv command in AUTOEXEC.BAT.)

    If every line in the "Buffering" column says "no," you can remove the device command for SMARTDRV.EXE from your CONFIG.SYS file.

    If any line in the "Buffering" column contains the character "-", then SMARTDrive is unable to detect whether double buffering is needed. Use the mem /c /p command to confirm that programs are located in upper memory.

Example

Suppose you need to use SMARTDrive's double-buffering feature so that you can use EMM386 to gain access to the upper memory area. To enable double buffering, you would add the following command to your CONFIG.SYS file:

device=c:\dos\smartdrv.exe /double_buffer 

To improve your computer's speed, you could also install the SMARTDrive disk cache by adding the following line to your AUTOEXEC.BAT file:

c:\dos\smartdrv 
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft