Dpath

In вычислительной технике, dpath is an internal cmd.exe команда on IBM OS/2[1] and Microsoft Windows[2][3] that allows using a set of files with the TYPE command and with перенаправлением ввода, as if they are in the current directory. On Windows it is undocumented and deprecated. dpath differs from the append command in the way it operates. dpath informs programs what directories they should search in order to find файлы компьютера. It is then up to the applications to recognize %DPATH%. Using the append command on the other side, programs are able to find files without recognizing that the command is in effect.

История

В DOS команда appendпозволяет программам открывать файлы данных в указанных каталогах так, как если бы они находились в текущем каталоге. Начиная с Windows NT, это не работает, поскольку cmd.exe ввел расширения процессора команд и appendстал избыточным. Несмотря на это, исполняемый файл был и остается доступным в 32-битных версиях Windows. В любом случае, команда полагалась на %DPATH% переменную среды, которую можно редактировать с помощью dpathкоманды. В современных установках Windows dpathработает только команда, несмотря на то, что справочное сообщение по-прежнему указывает на appendкоманду. [4][5]

Синтаксис

     DPATH pathname [;pathname] [;pathname] [;pathname]...
     DPATH
     DPATH ;
  pathname : drive letter and/or folder
   ;       : the command 'DPATH ;' will clear the path

Без параметров отобразится текущий список каталогов. %DPATH%Также можно использовать редактирование переменной среды. Команда `DPATH /?` выведет appendсправку по команде.

Использование

Перенаправление ввода: [4]

C:\>echo hello>c:\test\in.txt
C:\batch>type c:\test\in.txt
hello
C:\>dir /a /b
C:\>set /p var=<in.txt
The system cannot find the file specified.
C:\>set var
Environment variable var not defined
C:\>dpath c:\test;
C:\>set /p var=<in.txt
C:\>set var
var=hello

С помощью команды TYPE: [5]

C:\>echo hello>c:\test\in.txt
C:\batch>type c:\test\in.txt
hello
C:\>dir /a /b
C:\>set /p var=<in.txt
The system cannot find the file specified.
C:\>type in.txt
hello

См. также

Ссылки

Дополнительная информация

Источники

  • Участники английской Википедии. «Dpath». Перевод на русский. CC BY-SA 4.0 (текст и перевод).

Источники иллюстраций

  1. Wikibooks-logo-en-noslogan.svg · Лицензия файла уточняется
Соглашение О проекте Обратная связь
2026, Альфапедия. Список материалов:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25