Working directory: Difference between revisions

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
imported>Guy Harris
Use the general concept of a relative path, and give paths not beginning with / (Unix-like) or \ (Windows) as examples. (This dates at least back to Multics, where a pathname beginning with neither > nor < is relative.)
 
imported>DreamRimmer bot II
m Bot: Implementing outcome of RfC: converting list-defined references from {{reflist|refs=…}} to <references>…</references> for VisualEditor compatibility
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Short description|Attribute of a process}}
{{Short description|Default directory for file-system operations}}
{{Use dmy dates|date=July 2019|cs1-dates=y}}
{{Use dmy dates|date=July 2019|cs1-dates=y}}
{{Use list-defined references|date=December 2021}}
{{Use list-defined references|date=December 2021}}
In [[computing]], the '''working directory''' of a [[process (computing)|process]] is a [[directory (file systems)|directory]] of a [[hierarchical file system]], if any,<ref group="nb" name="NB_DX10"/> dynamically associated with the process. It is sometimes called the '''current working directory (CWD)''', e.g. the [[BSD]] <kbd>getcwd</kbd><ref name="getcwd"/> function, or just '''current directory'''.<ref name="SetCurrentDirectory"/> When a process refers to a file using a [[path (computing)|path]] that is a [[relative path]], such as a path on a [[Unix-like]] system that does not begin with a <kbd>/</kbd> (forward slash) or a path on [[Windows]] that does not begin with a <kbd>\</kbd> (backward slash), the path is interpreted as relative to the process's working directory. So, for example a process on a Unix-like system with working directory <kbd>/rabbit-shoes</kbd> that attempts to create the file <kbd>foo.txt</kbd> will end up creating the file <kbd>/rabbit-shoes/foo.txt</kbd>.
In computing, the '''working directory''' is the [[Directory (computing)|directory]] of a [[file system]] to which a [[relative path]]{{efn| such as a [[Unix]] path that does not begin with slash (/) or a [[Windows]] path that does not begin with backslash (\)}} is relative.


==In operating systems==
In a [[command-line]] environment, a [[User (computing)|user]] often uses files in or relative to the working directory. The system [[State (computer science)|state]] that identifies the working directory provides a convenient way to define the context of work. Users can use paths that are conceptually simpler and usually shorter, instead of always using [[Fully qualified name| absolute]] paths.  For example, for working directory <kbd>/home/user/data</kbd> on a [[Unix-like]] system, the [[file name]] <kbd>foo.txt</kbd> (a relative path) refers to absolute path <kbd>/home/user/data/foo.txt</kbd>. System state for working directory often also applies in a [[graphical user interface]] (GUI), but often is not useful since the GUI environment maintains directory context in a different way.
{{further|cd (command)|operating system shell}}
In most computer file systems, every directory has an entry (usually named "<kbd>.</kbd>") which points to the directory itself.


In most [[DOS]] and [[Unix|UNIX]] [[command-line interface|command shell]]s, as well as in the [[Microsoft Windows]] command line interpreters [[cmd.exe]] and [[Windows PowerShell]], the working directory can be changed by using the <kbd>[[CD (command)|CD]]</kbd> or <kbd>[[CHDIR (command)|CHDIR]]</kbd> [[command (computing)|command]]s. In [[Unix shell]]s, the <kbd>[[pwd]]</kbd> command outputs a full pathname of the working directory; the equivalent command in DOS and Windows is <kbd>CD</kbd> or <kbd>CHDIR</kbd> without [[parameter (computer science)|arguments]] (whereas in Unix, <kbd>cd</kbd> used without arguments takes the user back to their [[home directory]]).
As a feature, working directories vary by environment yet have some common, typical attributes. Typically, each [[process (computing)|process]] has a separate working directory, which allows users to have a different working directory for each [[shell (computing)|shell]] running on the [[computer]]. Although common in systems that provide a [[hierarchical file system]], the working directory feature is not required; for example, the [[DX10 operating system]] does not provide it, as all pathnames are either absolute or relative to the system volume.<ref>{{cite book |url=https://bitsavers.org/pdf/ti/990/dx10/0946250-9702D_DX10_Vol2_OperationsGuide_Sep82.pdf |title=DX10 Operating System Operations Guide |at=7.4 Using Pathnames |publisher=[[Texas Instruments]] |date=1982-09-01}}</ref>


The [[environment variable]] <kbd>PWD</kbd> (in Unix/Linux shells), or the [[pseudo-environment variable]]s <kbd>[[CD (pseudo-environment variable)|CD]]</kbd> (in Windows [[COMMAND.COM]] and [[cmd.exe]], but not in OS/2 and DOS), or <kbd>_CWD</kbd>, <kbd>_CWDS</kbd>, <kbd>_CWP</kbd> and <kbd>_CWPS</kbd> (under [[4DOS]], [[4OS2]], [[4NT (shell)|4NT]] etc.)<ref name="4DOS_8.00_HELP"/> can be used in scripts, so that one need not start an external program. [[Microsoft Windows]] [[file shortcut]]s have the ability to store the working directory.
Alternate names include '''current working directory (CWD)'''{{efn |as used in the command {{code |getcwd}}<ref name="getcwd"/>.}} and just '''current directory'''.<ref name="SetCurrentDirectory"/>


COMMAND.COM in [[DR-DOS 7.02]] and higher provides <kbd>ECHOS</kbd>, a variant of the <kbd>[[ECHO (DOS command)|ECHO]]</kbd> command omitting the terminating linefeed.<ref name="Caldera_1998_NEW703"/><ref name="4DOS_8.00_HELP"/> This can be used to create a temporary batchjob storing the working directory in an environment variable like <kbd>CD</kbd> for later use, for example:
==Use==
ECHOS SET CD=> SETCD.BAT
; Change directory: Many [[shell (computing)|shells]] provide a <code>[[CD (command)|cd]]</code> [[command (computing)|command]] for setting the working directory. Some systems provide a command with a different name. For example, {{code |chdir}} is an alternate name for {{code |cd}} in DOS/Windows.
CHDIR >> SETCD.BAT
 
CALL SETCD.BAT
; Report: Commands for reporting the working directory vary more than setting it. Typically, a [[Unix shell]] provides the command <code>[[pwd]]</code> (short for ''print working directory'') that reports the absolute path to the working directory. The equivalent command in DOS/Windows is <code>cd</code> without [[parameter (computer science)|arguments]]. Using <code>cd</code> without arguments in Unix-like systems generally sets the working directory to the user's [[home directory]].
DEL SETCD.BAT
 
Alternatively, under [[Multiuser DOS]] and [[DR-DOS 7.02]] and higher, various internal and external commands support a parameter <kbd>/B</kbd> (for "Batch").<ref name="CCI_1997_HELP"/> This modifies the output of commands to become suitable for direct command line input (when redirecting it into a batch file) or usage as a parameter for other commands (using it as input for another command). Where <kbd>CHDIR</kbd> would issue a directory path like <code>C:\DOS</code>, a command like <kbd>CHDIR /B</kbd> would issue <code>CHDIR C:\DOS</code> instead, so that <kbd>CHDIR /B > RETDIR.BAT</kbd> would create a temporary batchjob allowing to return to this directory later on.
; Scripting: To ease scripting development, some shells provide a [[variable (computing)|variable]] that contains the working-directory path. Typically, a Unix-like shell provides an [[environment variable]] named <kbd>PWD</kbd>. Windows shells [[COMMAND.COM]] and [[cmd.exe]] provide a [[pseudo-environment variable]] named <kbd>[[CD (pseudo-environment variable)|CD]]</kbd>. Shells [[4DOS]], [[4OS2]], and [[4NT (shell)|4NT]] provide <kbd>_CWD</kbd>, <kbd>_CWDS</kbd>, <kbd>_CWP</kbd>, and <kbd>_CWPS</kbd><ref name="4DOS_8.00_HELP"/>  
 
; Windows shortcut: A [[Windows]] [[file shortcut]] can store the working directory.{{clarify|in what way can a shortcut store the working directory? kinda defeats the point of working directory if you store it in a file IMO|date=October 2025}}
 
; Command-line prompt: The working directory is displayed by the <kbd>$P</kbd><ref group="nb" name="NB_PROMPT"/> token of the [[PROMPT (DOS command)|DOS <code>prompt</code> command]].<ref name="Caldera_1998_USER"/> To keep the prompt short in a deep directory, the DR-DOS 7.07 COMMAND.COM supports a <kbd>$W</kbd><ref group="nb" name="NB_PROMPT"/> token to display only the deepest subdirectory level. So, where a default <kbd>PROMPT $P$G</kbd> would result f.e. in <code>C:\DOS></code> or <code>C:\DOS\DRDOS></code>, a <kbd>PROMPT $N:$W$G</kbd> would instead yield <code>C:DOS></code> and <code>C:DRDOS></code>, respectively. A similar facility (using <kbd>$W</kbd> and <kbd>$w</kbd>) was added to [[4DOS]] as well.<ref name="4DOS_8.00_HELP"/>
 
; State for each DOS drive: {{anchor|CDS}}Under DOS, the absolute path to the working directory for each logical volume is stored as the current directory structure (CDS). It is allocated at boot time with a slot for each logical drive (or as defined by [[LASTDRIVE (CONFIG.SYS directive)|LASTDRIVE]]).<ref name="Schulman_1994_Undocumented-DOS"/><ref name="Paul_1997_NWDOSTIP"/><ref name="Brown_2000_RBIL"/> This structure imposes a length-limit of 66 characters on the full path of each working directory, and thus implicitly also limits the maximum possible depth of subdirectories.<ref name="Schulman_1994_Undocumented-DOS"/>
 
: [[DOS Plus]] and older issues of DR&nbsp;DOS (up to [[DR&nbsp;DOS 6.0]], with [[BDOS]] 6.7 in 1991) had no such limitation<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_1997_NWDOS7UN"/><ref name="4DOS_8.00_HELP"/> due to their implementations using [[PCMODE|DOS emulation]] on top of a [[Concurrent DOS]]- (and thus [[CP/M-86]]-)derived kernel, which internally organized subdirectories as ''relative'' links to parent directories instead of as ''absolute'' paths.<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_1997_NWDOS7UN"/> Since [[PalmDOS]] (with BDOS 7.0) and DR&nbsp;DOS 6.0 (1992 update with BDOS 7.1) and higher switched to use a CDS for [[bug compatibility|maximum compatibility]] with DOS programs as well, they faced the same limitations as present in other DOSes.<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_1997_NWDOS7UN"/>
 
; High-level language access: Most [[programming language|programming-language]] environments provide an [[application programming interface]] to the [[file system]] for getting and setting the working directory.
 
: The [[POSIX]]-defined function <code>chdir()</code> (accessible via [[C language |C]] and the many languages that interoperate with it) is a [[system call]] that changes the working directory.<ref name="OGBS"/> Its argument is a [[string data type |text string]] that is a path to the target directory, either absolute or relative to the existing value.


The working directory is also displayed by the <kbd>$P</kbd><ref group="nb" name="NB_PROMPT"/> token of the <code>[[PROMPT (DOS command)|PROMPT]]</code> command <ref name="Caldera_1998_USER"/> To keep the prompt short even inside of deep subdirectory structures, the DR-DOS 7.07 COMMAND.COM supports a <kbd>$W</kbd><ref group="nb" name="NB_PROMPT"/> token to display only the deepest subdirectory level. So, where a default <kbd>PROMPT $P$G</kbd> would result f.e. in <code>C:\DOS></code> or <code>C:\DOS\DRDOS></code>, a <kbd>PROMPT $N:$W$G</kbd> would instead yield <code>C:DOS></code> and <code>C:DRDOS></code>, respectively. A similar facility (using <kbd>$W</kbd> and <kbd>$w</kbd>) was added to [[4DOS]] as well.<ref name="4DOS_8.00_HELP"/>
: [[Visual Basic]] provides the same functionality via a function with the same name.


{{anchor|CDS}}Under DOS, the absolute paths of the working directories of all logical volumes are internally stored in an array-like data structure called the Current Directory Structure (CDS), which gets dynamically allocated at boot time to hold the necessary number of slots for all logical drives (or as defined by [[LASTDRIVE (CONFIG.SYS directive)|LASTDRIVE]]).<ref name="Schulman_1994_Undocumented-DOS"/><ref name="Paul_1997_NWDOSTIP"/><ref name="Brown_2000_RBIL"/> This structure imposes a length-limit of 66 characters on the full path of each working directory, and thus implicitly also limits the maximum possible depth of subdirectories.<ref name="Schulman_1994_Undocumented-DOS"/>  
: In [[Java (programming language)|Java]], the working directory can be obtained via the <code>java.nio.file.Path</code> interface, or the <code>java.io.File</code> class. The working directory cannot be changed.<ref name="Sun"/>
[[DOS Plus]] and older issues of DR&nbsp;DOS (up to [[DR&nbsp;DOS 6.0]], with [[BDOS]] 6.7 in 1991) had no such limitation<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_1997_NWDOS7UN"/><ref name="4DOS_8.00_HELP"/> due to their implementation using a [[PCMODE|DOS emulation]] on top of a [[Concurrent DOS]]- (and thus [[CP/M-86]]-)derived kernel, which internally organized subdirectories as ''relative'' links to parent directories instead of as ''absolute'' paths.<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_1997_NWDOS7UN"/> Since [[PalmDOS]] (with BDOS 7.0) and DR&nbsp;DOS 6.0 (1992 update with BDOS 7.1) and higher switched to use a CDS for [[bug compatibility|maximum compatibility]] with DOS programs as well, they faced the same limitations as present in other DOSes.<ref name="Paul_1997_NWDOSTIP"/><ref name="Paul_1997_NWDOS7UN"/>


==In programming languages==
==Examples==
<!-- can become a separate article [[chdir]], if one is willing to split -->
Most [[programming language]]s provide an [[application programming interface|interface]] to the [[file system]] functions of the operating system, including the ability to set (change) the working directory of the program.


In the [[C language]], the [[POSIX]] function '''<code>chdir()</code>''' effects the [[system call]] which changes the working directory.<ref name="OGBS"/> Its argument is a [[string data type|text string]] with a path to the new directory, either absolute or relative to the old one. Where available, it can be called by a process to set its working directory.
COMMAND.COM in [[DR-DOS 7.02]] and higher provides <code>ECHOS</code>, a variant of the <code>[[ECHO (DOS command)|ECHO]]</code> command that omits the terminating linefeed.<ref name="Caldera_1998_NEW703"/><ref name="4DOS_8.00_HELP"/> This can be used to create a temporary batchjob storing the working directory in an environment variable like <kbd>CD</kbd> for later use. For example:


There are similar functions in other languages. For example, in [[Visual Basic]] it is usually spelled <code>CHDIR()</code>.
ECHOS SET CD=> SETCD.BAT
CHDIR >> SETCD.BAT
CALL SETCD.BAT
DEL SETCD.BAT


In [[Java (programming language)|Java]], the working directory can be obtained through the <code>java.nio.file.Path</code> interface, or through the <code>java.io.File</code> class. The working directory cannot be changed.<ref name="Sun"/>
Alternatively, under [[Multiuser DOS]] and [[DR-DOS 7.02]] and higher, various internal and external commands support a parameter <kbd>/B</kbd> (for "Batch").<ref name="CCI_1997_HELP"/> This modifies the output of commands to become suitable for direct command-line input (when redirecting it into a [[batch file]]) or usage as a parameter for other commands (using it as input for another command). Where <kbd>CHDIR</kbd> would issue a directory path like <code>C:\DOS</code>, a command like <kbd>CHDIR /B</kbd> would issue <code>CHDIR C:\DOS</code> instead, so that <kbd>CHDIR /B > RETDIR.BAT</kbd> would create a temporary batchjob allowing returning to this directory later on.


==See also==
==See also==
* [[Home directory]]
* {{Annotated link |chroot}}
* [[Root directory]]
* {{Annotated link |Home directory}}
* [[Directory (computing)|Directory]]
* {{Annotated link |Load drive}}
* [[chroot]] (Linux systems)
* {{Annotated link |Long filename}}
* [[Load drive]] (a different, but related concept)
* {{Annotated link |Root directory}}
* [[Long filename]] (LFN)


==Notes==
==Notes==
{{notelist}}
{{reflist|group="nb"|refs=
{{reflist|group="nb"|refs=
<ref group="nb" name="NB_DX10">There are [[operating system]]s that support a [[hierarchical file system]] but have no concept of "working directory"; for example [[Texas Instruments]]' [[DX10 operating system|DX10]], used for the [[TI-990]] series.</ref>
<ref group="nb" name="NB_PROMPT">In the same way as <kbd>$O</kbd> works as alternative to <kbd>$P</kbd> under [[DR-DOS]] [[COMMAND.COM]], <kbd>$W</kbd> has an alias <kbd>$Y</kbd> except for that it gets suppressed on [[floppies]] in order to avoid [[critical error]] messages or delays when trying to retrieve the path of a non-inserted floppy.</ref>
<ref group="nb" name="NB_PROMPT">In the same way as <kbd>$O</kbd> works as alternative to <kbd>$P</kbd> under [[DR-DOS]] [[COMMAND.COM]], <kbd>$W</kbd> has an alias <kbd>$Y</kbd> except for that it gets suppressed on [[floppies]] in order to avoid [[critical error]] messages or delays when trying to retrieve the path of a non-inserted floppy.</ref>
}}
}}


==References==
==References==
{{reflist|refs=
<references>
 
<ref name="SetCurrentDirectory">{{cite web |title=Microsoft Windows – SetCurrentDirectory function |publisher=[[Microsoft]] |url=https://msdn.microsoft.com/de-de/library/windows/desktop/aa365530(v=vs.85).aspx |access-date=2017-05-27 |url-status=live |archive-url=https://web.archive.org/web/20180527133642/https://msdn.microsoft.com/de-de/library/windows/desktop/aa365530(v=vs.85).aspx |archive-date=2018-05-27}}</ref>
<ref name="SetCurrentDirectory">{{cite web |title=Microsoft Windows – SetCurrentDirectory function |publisher=[[Microsoft]] |url=https://msdn.microsoft.com/de-de/library/windows/desktop/aa365530(v=vs.85).aspx |access-date=2017-05-27 |url-status=live |archive-url=https://web.archive.org/web/20180527133642/https://msdn.microsoft.com/de-de/library/windows/desktop/aa365530(v=vs.85).aspx |archive-date=2018-05-27}}</ref>
<ref name="OGBS">{{cite web |title=The Open Group Base Specifications Issue 6 and IEEE Std 1003.1 |date=2004 |edition=Issue 6, 2004 |orig-year=2001 |publisher=The [[IEEE]] and [[The Open Group]] |url=http://www.opengroup.org/onlinepubs/009695399/functions/chdir.html |access-date=2018-05-27 |url-status=live |archive-url=https://web.archive.org/web/20180209195409/http://pubs.opengroup.org/onlinepubs/009695399/functions/chdir.html |archive-date=2018-02-09}}</ref>
<ref name="OGBS">{{cite web |title=The Open Group Base Specifications Issue 6 and IEEE Std 1003.1 |date=2004 |edition=Issue 6, 2004 |orig-year=2001 |publisher=The [[IEEE]] and [[The Open Group]] |url=http://www.opengroup.org/onlinepubs/009695399/functions/chdir.html |access-date=2018-05-27 |url-status=live |archive-url=https://web.archive.org/web/20180209195409/http://pubs.opengroup.org/onlinepubs/009695399/functions/chdir.html |archive-date=2018-02-09}}</ref>
Line 63: Line 73:
<ref name="Brown_2000_RBIL">{{cite web |title=Ralf Brown's Interrupt List |editor-first1=Ralf D. |editor-last1=Brown |editor-link1=Ralf D. Brown |display-editors=etal |edition=61 |id=[[INTER61]] |date=2000-07-16 |url=https://www.cs.cmu.edu/~ralf/files.html}}</ref>
<ref name="Brown_2000_RBIL">{{cite web |title=Ralf Brown's Interrupt List |editor-first1=Ralf D. |editor-last1=Brown |editor-link1=Ralf D. Brown |display-editors=etal |edition=61 |id=[[INTER61]] |date=2000-07-16 |url=https://www.cs.cmu.edu/~ralf/files.html}}</ref>
<ref name="getcwd">{{man|3|getcwd|FreeBSD||inline}}</ref>
<ref name="getcwd">{{man|3|getcwd|FreeBSD||inline}}</ref>
}}
 
</references>


==Further reading==
==Further reading==

Latest revision as of 14:05, 19 December 2025

Template:Short description Template:Use dmy dates Template:Use list-defined references In computing, the working directory is the directory of a file system to which a relative pathTemplate:Efn is relative.

In a command-line environment, a user often uses files in or relative to the working directory. The system state that identifies the working directory provides a convenient way to define the context of work. Users can use paths that are conceptually simpler and usually shorter, instead of always using absolute paths. For example, for working directory /home/user/data on a Unix-like system, the file name foo.txt (a relative path) refers to absolute path /home/user/data/foo.txt. System state for working directory often also applies in a graphical user interface (GUI), but often is not useful since the GUI environment maintains directory context in a different way.

As a feature, working directories vary by environment yet have some common, typical attributes. Typically, each process has a separate working directory, which allows users to have a different working directory for each shell running on the computer. Although common in systems that provide a hierarchical file system, the working directory feature is not required; for example, the DX10 operating system does not provide it, as all pathnames are either absolute or relative to the system volume.[1]

Alternate names include current working directory (CWD)Template:Efn and just current directory.[2]

Use

Change directory
Many shells provide a cd command for setting the working directory. Some systems provide a command with a different name. For example, chdir is an alternate name for cd in DOS/Windows.
Report
Commands for reporting the working directory vary more than setting it. Typically, a Unix shell provides the command pwd (short for print working directory) that reports the absolute path to the working directory. The equivalent command in DOS/Windows is cd without arguments. Using cd without arguments in Unix-like systems generally sets the working directory to the user's home directory.
Scripting
To ease scripting development, some shells provide a variable that contains the working-directory path. Typically, a Unix-like shell provides an environment variable named PWD. Windows shells COMMAND.COM and cmd.exe provide a pseudo-environment variable named CD. Shells 4DOS, 4OS2, and 4NT provide _CWD, _CWDS, _CWP, and _CWPS[3]
Windows shortcut
A Windows file shortcut can store the working directory.Script error: No such module "Unsubst".
Command-line prompt
The working directory is displayed by the $P[nb 1] token of the DOS prompt command.[4] To keep the prompt short in a deep directory, the DR-DOS 7.07 COMMAND.COM supports a $W[nb 1] token to display only the deepest subdirectory level. So, where a default PROMPT $P$G would result f.e. in C:\DOS> or C:\DOS\DRDOS>, a PROMPT $N:$W$G would instead yield C:DOS> and C:DRDOS>, respectively. A similar facility (using $W and $w) was added to 4DOS as well.[3]
State for each DOS drive
Script error: No such module "anchor".Under DOS, the absolute path to the working directory for each logical volume is stored as the current directory structure (CDS). It is allocated at boot time with a slot for each logical drive (or as defined by LASTDRIVE).[5][6][7] This structure imposes a length-limit of 66 characters on the full path of each working directory, and thus implicitly also limits the maximum possible depth of subdirectories.[5]
DOS Plus and older issues of DR DOS (up to DR DOS 6.0, with BDOS 6.7 in 1991) had no such limitation[6][8][3] due to their implementations using DOS emulation on top of a Concurrent DOS- (and thus CP/M-86-)derived kernel, which internally organized subdirectories as relative links to parent directories instead of as absolute paths.[6][8] Since PalmDOS (with BDOS 7.0) and DR DOS 6.0 (1992 update with BDOS 7.1) and higher switched to use a CDS for maximum compatibility with DOS programs as well, they faced the same limitations as present in other DOSes.[6][8]
High-level language access
Most programming-language environments provide an application programming interface to the file system for getting and setting the working directory.
The POSIX-defined function chdir() (accessible via C and the many languages that interoperate with it) is a system call that changes the working directory.[9] Its argument is a text string that is a path to the target directory, either absolute or relative to the existing value.
Visual Basic provides the same functionality via a function with the same name.
In Java, the working directory can be obtained via the java.nio.file.Path interface, or the java.io.File class. The working directory cannot be changed.[10]

Examples

COMMAND.COM in DR-DOS 7.02 and higher provides ECHOS, a variant of the ECHO command that omits the terminating linefeed.[11][3] This can be used to create a temporary batchjob storing the working directory in an environment variable like CD for later use. For example:

ECHOS SET CD=> SETCD.BAT
CHDIR >> SETCD.BAT
CALL SETCD.BAT
DEL SETCD.BAT

Alternatively, under Multiuser DOS and DR-DOS 7.02 and higher, various internal and external commands support a parameter /B (for "Batch").[12] This modifies the output of commands to become suitable for direct command-line input (when redirecting it into a batch file) or usage as a parameter for other commands (using it as input for another command). Where CHDIR would issue a directory path like C:\DOS, a command like CHDIR /B would issue CHDIR C:\DOS instead, so that CHDIR /B > RETDIR.BAT would create a temporary batchjob allowing returning to this directory later on.

See also

Notes

Template:Notelist

<templatestyles src="Reflist/styles.css" />

  1. a b In the same way as $O works as alternative to $P under DR-DOS COMMAND.COM, $W has an alias $Y except for that it gets suppressed on floppies in order to avoid critical error messages or delays when trying to retrieve the path of a non-inserted floppy.

Script error: No such module "Check for unknown parameters".

References

  1. Script error: No such module "citation/CS1".
  2. Script error: No such module "citation/CS1".
  3. a b c d Script error: No such module "citation/CS1".
  4. Script error: No such module "citation/CS1".
  5. a b Script error: No such module "citation/CS1". (xviii+856+vi pages, 3.5-inch floppy) Errata: [1][2]
  6. a b c d Script error: No such module "citation/CS1". (NB. NWDOSTIP.TXT is a comprehensive work on Novell DOS 7 and OpenDOS 7.01, including the description of many undocumented features and internals. It is part of the author's yet larger MPDOSTIP.ZIP collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the NWDOSTIP.TXT file.) [3]
  7. Script error: No such module "citation/CS1".
  8. a b c Script error: No such module "citation/CS1".
  9. Script error: No such module "citation/CS1".
  10. Script error: No such module "citation/CS1".
  11. Script error: No such module "citation/CS1".
  12. Script error: No such module "citation/CS1".

Cite error: <ref> tag with name "getcwd" defined in <references> is not used in prior text.

Further reading

  • Script error: No such module "citation/CS1".
  • Script error: No such module "citation/CS1".

External links