ChDir

From BR Wiki
Revision as of 23:36, 12 December 2011 by Mikhail.zheleznov (talk | contribs) (Created ChDir page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The ChDir command displays or changes the current default directory. CD with the -N parameter to change or display any output to the screen. Output may be redirected to a file. CD without the -N and drive parameter will parameter will continue to display the current drive. This could affect current program.

Comments and Examples

For a display of the current default directory, type CHDIR and press <CR>.
The following example sets the default drive to drive A:

CHDIR A

If the current default directory is \sales and you wish to change it to \sales\december, any of the following commands will work:

CHDIR \sales\december
CHDIR december
CHDIR /december

You can change the default directory by typing CHDIR, a space, and the parameters that specify the desired path (separate each parameter with a comma or a space). If the specified path does not begin with a backslash (indicating the root directory), the system automatically places the pre-existing default directory path before the path you specify.
Business Rules automatically displays the name of the new default directory after the CHDIR command has been executed. If this is undesirable, the -N option may be used to turn the display off.

Syntax

File:HELP0032.jpg

Defaults

  1. Display the current directory drive and path.
  2. Change the current drive.
  3. Display the name of the new directory.

Parameters

The syntax of the CHDIR command allows you to choose either the default or one of four optional syntactical routes.

The first parameter in the top route, "Drive", is a DOS-like drive letter; it must be followed by a colon. The results of this parameter depend upon whether or not it is followed by the "path" parameter. When specified by itself, "drive" causes Business Rules to change the default drive to the one specified.

The "path" parameter may be specified after the drive letter (in the top route) to indicate the sequence of directories you wish to use as the default directory path. Each directory name must be preceded with a backslash (\\). If no backslash is present at the beginning of the directory name series, Business Rules automatically appends the newly specified path to the end of the current default directory path.

When path is specified, Business Rules changes the default directory on the specified drive, but it does not change the current drive. As an example, assume that the current default drive at your workstation is drive C. If you enter the following command, Business Rules will change the default drive to drive B:

CHDIR B:

But if you enter the following command, Business Rules will change the default subdirectory on drive B to \\BR\\DATA; the workstation will continue to access drive C, however:

CHDIR B:\\BR\\DATA

The second route through the CHDIR syntax is the System/23-format equivalent to the top route. "/Subdirectory/" is the name of a subdirectory that is to become the new default; the forward slashes indicate System/23 format. "Drive-num" is a System/23 drive number which Business Rules translates into a drive letter according to the information in the BRConfig.sys file's S/23-DRIVES specification. When this parameter is specified without a preceding subdirectory name, Business Rules changes the current drive to the drive specified. When a drive-num is preceded by a subdirectory name, Business Rules changes the default directory on the specified drive to the named subdirectory, but it does not change the current drive.

The third and fourth routes through the CHDIR syntax allow you to specify either the "path" or the "/subdirectory" parameters to change the default directory on the default drive. "Path" is the sequence of directories that is to become the default. When it is not preceded by a backslash, Business Rules automatically appends the specification to the end of the current default directory path. "/Subdirectory" is the System/23-format equivalent to the path parameter.

The "-N" option may be used to turn off the automatic display of the new directory. This can be useful with PROC NOECHO.

Technical Considerations

When "CD -N" is specified, the -N parameter will be overridden by the request for a display of the current directory.