A
A
AsIntelligence2021-02-09 00:41:31
HTML
AsIntelligence, 2021-02-09 00:41:31

How to designate a disk change when specifying a relative path?

C:\Documents\Newsletters\Summer2018.pdf The absolute path to the file from the root of the C: drive.
\Program Files\Custom Utilities\StringFinder.exe Absolute path from the root of the current drive.
2018\January.xlsx Relative path to a file in a subdirectory of the current directory.
..\Publications\TravelBrochure.pdf Relative path to a file in a directory that is a peer of the current directory.
C:\Projects\apilibrary\apilibrary.sln Absolute path to the file from the root of the C: drive.
C:Projects\apilibrary\apilibrary.sln Relative path from the current directory on drive C:.

The question arose when I tried to specify a relative path to a file located on another disk, how is it possible to specify a relative path to a file located on another disk?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wisgest, 2021-02-09
@AsIntelligence

For each disk, you can set your own working directory, for example, using the command CDwithout the /D; example:
cd h:\a\b\c
All relative (not from the root) paths for this drive will be expanded relative to this directory, i.e. will be expanded to h:d\e.doc, h:\a\b\c\d\e.docbut h:..\f.docto h:\a\b\f.doc.

These paths are stored in environment variables...
Эти пути хранятся в недокументированных переменных среды с именем вида =D: (D— буква диска); и простой командой SET стандартного обработчика командной строки Windows NT не выводятся, но если они определены, их можно увидеть в выводе командыSET "" (или даже SET "):
To display undocumented system variables:
SET "
— ss64.com/nt/set.html, см. также Rob van der Woude — Dynamic Environment Variables.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question