Windows 7 dos path

If you are used to the interface of Microsoft Windows 2000 or Windows 98 it is expected that you will never find any problem in locating any object in those operating systems as the entire DOS path is displayed in the title bar. However with the release of Microsoft Windows Vista and above operating systems this feature is disabled and no DOS path is now displayed in the title bar. Instead just the folder names are displayed there and users can easily navigate through the entire path by clicking on the desired folder available up there. From Microsoft’s point of view this feature adds a great advantage to the interface of the operating system as users are now not required to remember the entire path to locate any object and they are not required to click on Back button several times to go to parent folders of any object. However many people do not know that they can still view the entire DOS path without any extra configuration or settings. As a Windows 7 user if you want to view the entire DOS path of any object (precisely a folder) you are required to follow the steps given below:

  1. Logon to Windows 7 machine.

  2. Browse through navigate and locate the desired object (folder).

  3. Once located and reached in the title bar click at the end of the folder names.

  4. As you will do so you will be displayed with the full DOS path to that particular folder.

In computers, the desktop contains lots of files and folders. We must use GUI (Graphical user interface) to access and navigate files. GUI provides simple and fast navigation through all the files and folders. Still, there may be times when we want to access these CLI, commonly known as command line interfaces. CLI (command line interface) allows users to access files from the command line itself. This article will teach us about the Ms-dos (Microsoft disk operating system) path for all Windows versions.

Follow these steps mentioned in the below section to get the path for the Windows desktop. We will look at the paths of the following versions of Windows.

  • Windows 95, Windows 98 and other Millennium editions
  • Windows 2000, Windows 2003 and Windows XP
  • Windows Vista, Windows 7, Windows 8, Windows 10

1. Windows 95, Windows 98 and other millennium editions (ME)

In the versions mentioned above of Windows, when we enter inside the MS-DOS prompt, you will be automatically inside the directory of the desktop.

There may be a few cases when you are not automatically present inside the directory. In such a case, you will need to enter the directory manually. Use the below-given path to navigate through the desktop directory.

c:windowsdesktop

2. Windows 2000, Windows 2003 and Windows XP

Firstly, you will need to go inside your DOS command prompt. To enter the command prompt, follow the below steps.

Step 1: In the very first step, click on start.

Step 2: After that, click on the run.

Step 3: A dialog box will appear; type cmd in the appeared dialog box.

Step4: Press Enter

In the versions mentioned earlier of Windows, when we enter inside the MS-DOS prompt, you will be automatically inside the directory of username. So the only thing you need to do is navigate inside the desktop using the below command.

cd Desktop

A few cases may occur when you are not present automatically inside the username directory. In such a case, you must manually enter the directory. Use the below-given path to navigate through the desktop directory

c:docume~1(username)Desktop

In the above command, replace the (username) with the respective username of your Windows system.

3. Windows Vista, Windows 7, Windows 8, Windows 10

These are the most advanced versions of Windows and are used by most of them. Let us understand how to enter the directory using the below section.

Firstly, you will need to go inside your DOS command prompt. To enter the command prompt, follow the below steps.

Step 1: In the first step, click on the start or type here to search (search icon).

Step 2: A dialog box will appear; type cmd in the appeared dialog box.

Step3: Press Enter

Alternately, in Windows 8, you can go to a dos command prompt by simply clicking on the Windows key, typing cmd in the text field and then pressing Enter.

In the versions mentioned earlier of Windows, when we enter inside the MS-DOS prompt, you will be automatically inside the directory of username. So the only thing you need to do is navigate inside the desktop using the below command.

cd Desktop

A few cases may occur when you are not present automatically inside the username directory. In such a case, you must manually enter the directory. Use the below-given path to navigate through the desktop directory

c:Users(username)Desktop

In the above command, replace the (username) with the respective username of your Windows system.

Unable to find the desktop directory path

There may be some scenarios when you cannot find the path for your desktop directory. Here you should be able to find your desktop directory path manually.

Follow the below-given steps if the path is not found at the default location.

Step 1: Windows 8 and 10 users, navigate inside your file explorer. For Windows 7, first press on start and then computer.

Step 2: In next step, right-click on the desktop from the navigation pane present on the left side of the window.

Step 3:  Click on the properties option from the appeared to drop-down menu.  

Step 4: A new window of desktop properties will appear. Click on the location option, and you should be able to see your required path.r to the documentation for their keyboard, operating system, and software.

If you are here reading this post, it means you are looking for a way to convert your DOS and/or NT paths for your software. Rest assured that this is what you will learn here today!

The problem with Windows paths
are clear; it’s so confusing. Let me repeat that, so confusing. This becomes a problem when you are working on your amazing piece of software and you need to convert DOS and NT paths.

In this article I will try to keep things short and sweet, so let’s begin.

There are functions that are undocumented inside ntdll that can be used for different conversions. The list of these functions begin with Rtl* and are as follows:

  • RtlDosPathNameToNtPathName_U (all windows)
  • RtlDosPathNameToNtPathName_U_WithStatus (all windows)
  • RtlDosLongPathNameToNtPathName_U_WithStatus (windows 10 Redstone 3)
  • RtlDosPathNameToRelativeNtPathName_U (all windows)
  • RtlDosPathNameToRelativeNtPathName_U_WithStatus (all windows)
  • RtlDosLongPathNameToRelativeNtPathName_U_WithStatus (windows 10 Redstone 3)
  • RtlNtPathNameToDosPathName (all windows; This particular function is quite a mystery because you cannot find definitions or information about it anywhere. However we will test all these functions accordingly and see their output.)

The above functions have the same input/output parameters:

  • DosFileName (in – required): A constant string containing the DOS name of the target file or directory.
  • NtFileName (out – required): Return the NT path to a file or directory. Must use a UNICODE_STRING which does not need to be initialised.
  • FilePart (out – optional): At the output, the file name address in the generated path will be entered into the pointer. If this parameter is filled with NULL in the output, then only the directory name is specified.
  • RelativeName (out – optional): Pointer to a RTL_RELATIVE_NAME_U structure containing information about the current directory.

For our play with these functions I have defined 3 paths:

1static const wchar_t NormalNamespace[MAX_PATH]  = L"C:\\Windows\\System32\\csrss.exe"; // Normal Win32 namespace
2static const wchar_t DeviceNamespace[MAX_PATH]  = L"\\\\.\\C:\\Windows\\System32\\csrss.exe"; // Win32 Device Namespace
3static const wchar_t FileNamespace[MAX_PATH]    = L"\\\\?\\C:\\Windows\\System32\\csrss.exe"; // Win32 Device Namespace
4static const wchar_t DevicePath[MAX_PATH]       = L"\\Device\\HarddiskVolume1\\Windows\\System32\\csrss.exe"; // Win32 Device Path
5static const wchar_t ExtraTest[MAX_PATH]        = L"directory.name\\file.name"; // Relative Path

Using RtlDosPathNameToNtPathName\_U

This function will return a BOOLEAN.

  • TRUE – The path transform operation completed successfully.
  • FALSE – The path conversion operation failed.

Code:

 1{
 2    UNICODE_STRING Converted{};
 3    RTL_RELATIVE_NAME_U RelativeName{};
 4    PWSTR FilePart{};
 5
 6    static const wchar_t NormalNamespace[MAX_PATH]  = L"C:\\Windows\\System32\\csrss.exe"; // Normal Win32 namespace
 7    static const wchar_t DeviceNamespace[MAX_PATH]  = L"\\\\.\\C:\\Windows\\System32\\csrss.exe"; // Win32 Device Namespace
 8    static const wchar_t FileNamespace[MAX_PATH]    = L"\\\\?\\C:\\Windows\\System32\\csrss.exe"; // Win32 Device Namespace
 9    static const wchar_t DevicePath[MAX_PATH]       = L"\\Device\\HarddiskVolume1\\Windows\\System32\\csrss.exe"; // Win32 Device Path
10    static const wchar_t ExtraTest[MAX_PATH]        = L"directory.name\\file.name"; // Relative Path
11
12    pRtlDosPathNameToNtPathName_U _RtlDosPathNameToNtPathName_U = reinterpret_cast<pRtlDosPathNameToNtPathName_U>(GetProcAddress(GetModuleHandle(L"ntdll.dll"), "RtlDosPathNameToNtPathName_U"));
13
14    if (_RtlDosPathNameToNtPathName_U(NormalNamespace, &Converted, &FilePart, &RelativeName))
15    {
16        std::wcout << L"[NormalNamespace] (previous): " << NormalNamespace << std::endl;
17        std::wcout << L"[NormalNamespace] (converted): " << Converted.Buffer << std::endl;
18        std::wcout << L"[NormalNamespace] FilePart: " << FilePart << std::endl;
19        std::wcout << L"[NormalNamespace] RelativeName.Buffer: " << ((RelativeName.RelativeName.Buffer != NULL) ? RelativeName.RelativeName.Buffer : L"NULL") << std::endl;
20        std::wcout << L"[NormalNamespace] ContainingDirectory: " << (void*)RelativeName.ContainingDirectory << std::endl;
21        std::wcout << L"[NormalNamespace] CurDirRef->DirectoryHandle: " << ((RelativeName.CurDirRef != nullptr) ? (void*)RelativeName.CurDirRef->DirectoryHandle : L"NULL") << std::endl;
22        std::wcout << L"[NormalNamespace] CurDirRef->ReferenceCount: " << ((RelativeName.CurDirRef != nullptr) ? RelativeName.CurDirRef->ReferenceCount : 0UL) << std::endl;
23    }
24
25    std::wcout << L"------------------------------------------------------------------------" << std::endl;
26
27    Converted = { 0 };
28    RelativeName = { 0 };
29    FilePart = { 0 };
30
31    if (_RtlDosPathNameToNtPathName_U(DeviceNamespace, &Converted, &FilePart, &RelativeName))
32    {
33        std::wcout << L"[DeviceNamespace] (previous): " << DeviceNamespace << std::endl;
34        std::wcout << L"[DeviceNamespace] (converted): " << Converted.Buffer << std::endl;
35        std::wcout << L"[DeviceNamespace] FilePart: " << FilePart << std::endl;
36        std::wcout << L"[DeviceNamespace] RelativeName.Buffer: " << ((RelativeName.RelativeName.Buffer != NULL) ? RelativeName.RelativeName.Buffer : L"NULL") << std::endl;
37        std::wcout << L"[DeviceNamespace] ContainingDirectory: " << (void*)RelativeName.ContainingDirectory << std::endl;
38        std::wcout << L"[DeviceNamespace] CurDirRef->DirectoryHandle: " << ((RelativeName.CurDirRef != nullptr) ? (void*)RelativeName.CurDirRef->DirectoryHandle : L"NULL") << std::endl;
39        std::wcout << L"[DeviceNamespace] CurDirRef->ReferenceCount: " << ((RelativeName.CurDirRef != nullptr) ? RelativeName.CurDirRef->ReferenceCount : 0UL) << std::endl;
40    }
41
42    std::wcout << L"------------------------------------------------------------------------" << std::endl;
43
44    Converted = { 0 };
45    RelativeName = { 0 };
46    FilePart = { 0 };
47
48    if (_RtlDosPathNameToNtPathName_U(FileNamespace, &Converted, &FilePart, &RelativeName))
49    {
50        std::wcout << L"[FileNamespace] (previous): " << FileNamespace << std::endl;
51        std::wcout << L"[FileNamespace] (converted): " << Converted.Buffer << std::endl;
52        std::wcout << L"[FileNamespace] FilePart: " << FilePart << std::endl;
53        std::wcout << L"[FileNamespace] RelativeName.Buffer: " << ((RelativeName.RelativeName.Buffer != NULL) ? RelativeName.RelativeName.Buffer : L"NULL") << std::endl;
54        std::wcout << L"[FileNamespace] ContainingDirectory: " << (void*)RelativeName.ContainingDirectory << std::endl;
55        std::wcout << L"[FileNamespace] CurDirRef->DirectoryHandle: " << ((RelativeName.CurDirRef != nullptr) ? (void*)RelativeName.CurDirRef->DirectoryHandle : L"NULL") << std::endl;
56        std::wcout << L"[FileNamespace] CurDirRef->ReferenceCount: " << ((RelativeName.CurDirRef != nullptr) ? RelativeName.CurDirRef->ReferenceCount : 0UL) << std::endl;
57    }
58
59    std::wcout << L"------------------------------------------------------------------------" << std::endl;
60
61    Converted = { 0 };
62    RelativeName = { 0 };
63    FilePart = { 0 };
64
65    if (_RtlDosPathNameToNtPathName_U(DevicePath, &Converted, &FilePart, &RelativeName))
66    {
67        std::wcout << L"[DevicePath] (previous): " << DevicePath << std::endl;
68        std::wcout << L"[DevicePath] (converted): " << Converted.Buffer << std::endl;
69        std::wcout << L"[DevicePath] FilePart: " << FilePart << std::endl;
70        std::wcout << L"[DevicePath] RelativeName.Buffer: " << ((RelativeName.RelativeName.Buffer != NULL) ? RelativeName.RelativeName.Buffer : L"NULL") << std::endl;
71        std::wcout << L"[DevicePath] ContainingDirectory: " << (void*)RelativeName.ContainingDirectory << std::endl;
72        std::wcout << L"[DevicePath] CurDirRef->DirectoryHandle: " << ((RelativeName.CurDirRef != nullptr) ? (void*)RelativeName.CurDirRef->DirectoryHandle : L"NULL") << std::endl;
73        std::wcout << L"[DevicePath] CurDirRef->ReferenceCount: " << ((RelativeName.CurDirRef != nullptr) ? RelativeName.CurDirRef->ReferenceCount : 0UL) << std::endl;
74    }
75
76    std::wcout << L"------------------------------------------------------------------------" << std::endl;
77
78    Converted = { 0 };
79    RelativeName = { 0 };
80    FilePart = { 0 };
81
82    if (_RtlDosPathNameToNtPathName_U(ExtraTest, &Converted, &FilePart, &RelativeName))
83    {
84        std::wcout << L"[ExtraTest] (previous): " << ExtraTest << std::endl;
85        std::wcout << L"[ExtraTest] (converted): " << Converted.Buffer << std::endl;
86        std::wcout << L"[ExtraTest] FilePart: " << FilePart << std::endl;
87        std::wcout << L"[ExtraTest] RelativeName.Buffer: " << ((RelativeName.RelativeName.Buffer != NULL) ? RelativeName.RelativeName.Buffer : L"NULL") << std::endl;
88        std::wcout << L"[ExtraTest] ContainingDirectory: " << (void*)RelativeName.ContainingDirectory << std::endl;
89        std::wcout << L"[ExtraTest] CurDirRef->DirectoryHandle: " << ((RelativeName.CurDirRef != nullptr) ? (void*)RelativeName.CurDirRef->DirectoryHandle : L"NULL") << std::endl;
90        std::wcout << L"[ExtraTest] CurDirRef->ReferenceCount: " << ((RelativeName.CurDirRef != nullptr) ? RelativeName.CurDirRef->ReferenceCount : 0UL) << std::endl;
91    }
92}

Result:

RtlDosPathNameToNtPathName_U Output

Notes:

If you relative path, the function will still succeed. However the output will contain not only the NT path but it will also prepend the current working directory path. Check the last test result.

Using RtlDosPathNameToNtPathName\_U\_WithStatus

This function will return NTSTATUS instead of BOOLEAN.

It is exactly the same as the above one RtlDosPathNameToNtPathName_U, however with this version you can retrieve the last NTSTATUS if the function has failed.

Using RtlDosLongPathNameToNtPathName\_U\_WithStatus

This function will return NTSTATUS.

From my tests this function returned the exact same result as above, however with this version you can retrieve the last NTSTATUS if the function has failed.

This function is only available starting Windows 10 Redstone 3. I cannot find anything special about it.

From my guess it can convert longer paths, hence the “long” in the function name.

Using RtlDosPathNameToRelativeNtPathName\_U

This function will return a BOOLEAN.

From my tests this function returned the exact same result as above, so I`m not sure what’s the deal with it. (feel free to comment)

Using RtlDosPathNameToRelativeNtPathName\_U\_WithStatus

This function will return NTSTATUS instead of BOOLEAN.

From my tests this function returned the exact same result as above, so I`m not sure what’s the deal with it. (feel free to comment)

Using RtlDosLongPathNameToRelativeNtPathName\_U\_WithStatus

This function will return NTSTATUS instead of BOOLEAN.

Once again this function returned the same results, maybe I am calling it wrong. (feel free to comment)

This function is only available starting Windows 10 Redstone 3.

Using RtlNtPathNameToDosPathName

This function will return a NTSTATUS.

The function itself is interesting, as it’s purpose is to reverse what we achieved above. To be honest I had a hard time finding some documentation, like anything at all just to test it.

  • Flags (in – optional): I have no idea what it’s for.
  • Path (in/out – required): Pointer to RTL_UNICODE_STRING_BUFFER initialised structure. It will also contain the result after execution.
  • Disposition (in – optional): I have no idea what it’s for.
  • FilePart (out- optional): I have no idea what it’s for.

From my tests you can only convert paths and not full paths (eg. to a file) with this function. If you try a full path it will not convert it, but it will still execute normally o.O

Code:

 1{
 2
 3    RTL_UNICODE_STRING_BUFFER DosPath = { 0 };
 4    PWSTR FilePart{};
 5
 6    UNICODE_STRING NtPath;
 7    RtlInitUnicodeString(&NtPath, L"\\??\\C:\\WINDOWS\\system32\\drivers");
 8
 9    wchar_t* DosPathBuffer = NULL;
10    wchar_t* NtPathBuffer = NULL;
11
12    DosPathBuffer = (wchar_t*)new char[NtPath.Length + sizeof(wchar_t)];
13    NtPathBuffer  = (wchar_t*)new char[NtPath.Length + sizeof(wchar_t)];
14
15    RtlZeroMemory(DosPathBuffer, NtPath.Length + sizeof(wchar_t));
16    RtlZeroMemory(NtPathBuffer, NtPath.Length + sizeof(wchar_t));
17    RtlCopyMemory(DosPathBuffer, NtPath.Buffer, NtPath.Length);
18    RtlCopyMemory(NtPathBuffer, NtPath.Buffer, NtPath.Length);
19
20    DosPath.ByteBuffer.Buffer       = DosPathBuffer;
21    DosPath.ByteBuffer.StaticBuffer = NtPathBuffer;
22    DosPath.String.Buffer           = NtPath.Buffer;
23    DosPath.String.Length           = NtPath.Length;
24    DosPath.String.MaximumLength    = NtPath.Length;
25    DosPath.ByteBuffer.Size         = NtPath.Length;
26    DosPath.ByteBuffer.StaticSize   = NtPath.Length;
27
28    pRtlNtPathNameToDosPathName _RtlNtPathNameToDosPathName = reinterpret_cast<pRtlNtPathNameToDosPathName>(GetProcAddress(GetModuleHandle(L"ntdll.dll"), "RtlNtPathNameToDosPathName"));
29
30    if (NT_SUCCESS(_RtlNtPathNameToDosPathName(0, &DosPath, NULL, &FilePart)))
31    {
32        //RtlCopyMemory(pszDosPath, ByteDosPathBuffer, wcslen(ByteDosPathBuffer) * sizeof(wchar_t));
33
34        std::wcout << L"[NtPath] (previous): " << NtPath.Buffer << std::endl;
35        std::wcout << L"[DosPathBuffer] (converted): " << DosPathBuffer << std::endl;
36        std::wcout << L"[NtPathBuffer] (untouched): " << NtPathBuffer << std::endl;
37        std::wcout << L"[NormalNamespace] FilePart: " << ((FilePart != nullptr) ? FilePart : L"NULL") << std::endl;
38    }
39
40    std::wcout << L"------------------------------------------------------------------------" << std::endl;
41
42}

Result:

RtlNtPathNameToDosPathName Output

The code example I posted is confusing, however let me try to clear the air. What happens is that this function will replace the NT paths in the structure provided.

I have set a breakpoint before the function executes:

RtlNtPathNameToDosPathName Debug 1

And then after the function executes you can see the changes:

RtlNtPathNameToDosPathName Debug 2

So there you have it, a weird function that does NT to DOS path conversion.

I`m sorry that I cannot give more details on these functions, however please feel free to comment below with any additions.

Until next time.

Robert Wray wants to know if his old DOS programs will run in Windows 7.

Here’s the general rule: If the DOS program ran in XP, it will probably run in a 32-bit version of Windows 7. But no DOS program can ever run in a 64-bit version of Windows 7.

Except that there’s a workaround. I’ll explain it in a minute.

If you’re not sure whether your Windows is 32- or 64-bit, click the Start orb, right-click Computer, and select Properties. Look for the System type.

You can launch most DOS apps in a 32-bit version of Windows 7 simply by double-clicking the DOS program’s .exe or .com file. If it doesn’t work, or if there are problems, right-click the file and select Properties. Click the Compatibility tab. Check the “Run this program in compatibility mode for” option and select an older version of Windows. You may have to do some experimenting to find the right one.

And if none of those work, try the 64-bit solution below.

Actually, there are several solutions, all of which involve using software to create a virtual machine (VM) inside Windows. If you want to run a lot of different operating systems inside Windows, VMware Player is probably your best bet.

But if all you’re only looking for is a way to run DOS programs, try DOSBox, a free program that launches a DOS VM. I can’t promise it will work with every program you throw at it, but it worked for every one I tried.

Once you download and install DOSBox, here’s how to set it up so that it can find and work with your DOS programs and files:

  1. Create a folder (just as an example, let’s call it C:DOSFiles) and place in it every program and file you want DOSBox to access. You can use subfolders within that folder.
  2. Click Start, type notepad and press ENTER to bring up Notepad.
  3. Click Start, and select All Programs, DOSBox-0.74 (the version number may change), Extras, Screenshots & Recordings.
  4. This will open Windows Explorer to a probably empty folder inside the DOSBox configuration folder. In the path bar at the top of the window, click DOSBox to go to that folder.
  5. Drag the file dosbox-0.74.conf into Notepad. (The .conf part will probably not be visible.)
  6. In Notepad, go to the bottom of the file, where you’ll find the [autoexec] section.
  7. On a blank line at the end of the file, type mount driveletter path, where driveletter is the drive letter you wish to assign the folder to, and path is the path to that folder. For instance, mount a c:dosfiles wil make the C:DOSFiles folder appear as DOSBox’s drive A:.
  8. Save the file and launch DOSBox.

Contributing Editor Lincoln Spector writes about technology and cinema. Email your tech questions to him at answer@pcworld.com, or post them to a community of helpful folks on the PCW Answer Line forum. Follow Lincoln on Twitter, or subscribe to the Answer Line newsletter, e-mailed weekly.

Ericuse165 has a friend with a PC that’s making a grinding noise. Eric asked the Hard Drives, NAS Drives, Storage forum for advice.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Dell inspiron 5558 драйвера windows 10
  • Windows 7 sp1 обновление корневых сертификатов
  • Настройка теневых копий windows server 2019
  • Windows 7 aero activator
  • Free openvpn for windows