cdx—Enhanced Change Directory

The cdx command is an enhanced (eXtended) version of the CD (or CHDIR) command. Like CD, it can go to a specified directory. Unlike CD, it can also change the current drive at the same time. It can go to a default HOME directory. And it can search through a set of paths for the specified directory, eliminating the need for a lot of little command files to change directories.

The c: \tmp directory must exist and be writable for the Win32 and OS/2 versions of cdx. A temporary batch (command) file is written to c: \tmp by the cdx command for these platforms.

On DOS, the cdx command is implemented as cdx.bat. The cdx.bat script calls cdir.exe and cdir.exe changes the current directory and drive itself.

For Win32, the cdx command is implemented as the cdx.bat script. For OS/2, it is implemented as the cdx.cmd script. For these platforms, cdx calls cdir.exe just to get the path and drive change information and then cdx itself performs the change. This is because these platforms, like Unix, don't allow a process to change its parent process's environment or working directory.

For DOS, the cdx.bat file just invokes the cdir.exe program. You can, if you wish, run the cdir.exe program directly to change your current working drive and path. Using cdx instead just lets your fingers type the same command on DOS, OS/2, and Win32.

This command cannot be named cd, which is the name of the less-capable built-in DOS, Win32, and OS/2 command.



Subsections