11

This bothers me for ages, and I could not find the solution yet.

  1. Open Windows Explorer.
  2. Click on Desktop in the left sidebar.
  3. Click on "Desktop" in the address bar.

Result: Instead of C:\...\ it displays only Desktop.

Desktop Windows Explorer

Instead I would like to get the real physical path:

C:\Users\MyName\Desktop\

How to achieve this (settings in the Windows registry)?

phuclv
  • 26,555
  • 15
  • 113
  • 235
Avatar
  • 2,555
  • 4
  • 36
  • 50
  • One simple answer is to add it under _Quick access_. – AFH Oct 07 '19 at 10:33
  • 1. I am not using *Quick access*. 2. It is still the same, the path does not show up. – Avatar Oct 07 '19 at 10:45
  • This probably isn't quite the answer you are looking for, but if you go to `C:\Users\\Desktop`, it does put the full path up in the address bar. More clicks, but it does give you the full path technically. I know your pain however - I can't count how many times I've clicked the "Desktop" option and tried getting the path in the address bar for a quick copy and paste... – Tim G. Oct 07 '19 at 11:33
  • 2
    Logical path will always be `%UserProfile%\Desktop` – JW0914 Oct 07 '19 at 11:42
  • 1
    For the Desktop specifically, I think it's related to the ParsingName value under: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{754AC886-DF64-4CBA-86B5-F7FBF4FBCEF5} – HelpingHand Oct 07 '19 at 11:46
  • If you are willing to consider to top notch alternative, xPlorer2 (zabkat) does this with ease. Click on Desktop and xPlorer2 shows path consistently as C:\Users\jusername\Desktop in the display – John Oct 07 '19 at 12:01
  • 1
    @JW0914 that's not true. If onedrive backup is enabled then Documents, Desktop, Music, Pictures... will all be in a different folder – phuclv Nov 19 '22 at 15:13
  • @phuclv I wasn't aware of that, thanks for letting me know =] – JW0914 Jul 10 '23 at 21:09

11 Answers11

8

It's not possible to change this particular aspect of Windows' behaviour from the GUI but there is a nice workaround that doesn't require any third-party software:

  1. Open Windows Explorer: Windows+E.
  2. While holding Shift, perform a Right click ️ on the Desktop folder, then choose Copy as path from the context menu:

enter image description here

The full path of your Desktop folder is now copied to the clipboard and can be pasted into the address bar or wherever you require it.

Note that the path will include quotation marks that you'll need to remove in order for it to work properly in Windows Explorer.

This should give you something like this:

"C:\Users\Kai\Desktop"

Mr Ethernet
  • 4,191
  • 2
  • 16
  • 28
  • In Windows 10, I don't see the Copy as path in the Context menu. – user8356 Oct 07 '19 at 17:37
  • You will if you hold Shift while you perform the right mouse click. I think I need to rephrase my answer! – Mr Ethernet Oct 07 '19 at 17:38
  • 1
    No really, I was holding down Shift, and right-clicking the desktop -- but I the problem is, I was looking at a Favorites view in Explorer, not the Computer view. When I changed to that, I did have the "Copy as path" command. Good tip! – user8356 Oct 07 '19 at 17:46
  • It's a nice little shortcut. Useful for other things too, like when you need file paths for scripting. Most people don't even know it exists! – Mr Ethernet Oct 07 '19 at 17:58
  • Removing the question marks takes too much time. My workaround that I used until today (faster than your suggestion, I think): Open Desktop, open a folder, go to address bar, et voila: The path. – But as in the question, I want to click in the address bar and get the full path. One click and done :) – Avatar Oct 08 '19 at 05:30
  • *quotation marks. And not if you use the `Home` and `End` keys. Sounds like you might be holding down the arrow keys, which would slow things down quite a bit. Microsoft should provide an option to revert to the old behaviour. I've got used to it now but I still think it was an awful design decision. My parents gave up trying to understand it long ago! – Mr Ethernet Oct 08 '19 at 05:38
3

%UserProfile%\Desktop is wrong!!! Never use it

Special folders can be moved around easily, that's why there are registry entries for them, otherwise we'd just need to hard code them everywhere. Even Windows could be installed into a different folder/drive than C:\Windows and Program Files can be changed. Same to Documents, Pictures, Desktops... Nowadays Windows tend to enable OneDrive backup by default and user special folders will not be in the user's home path anymore. And even the OneDrive folder path can be changed

Desktop properties

See %USERPROFILE%/Desktop no longer valid after relocating Desktop folder to OneDrive

To get the path reliably you'll need to call this by running the below command in PowerShell

[Environment]::GetFolderPath([Environment+SpecialFolder]::Desktop)

Alternatively you can run this in PowerShell

(New-Object –ComObject Shell.Application).namespace(0x10).Self.Path

0x10 here is the Shell Special Folder Constant for desktop

Another PowerShell way:

$c = New-Object -ComObject Wscript.Shell
$c.SpecialFolders("Desktop")

The above last 2 solutions deal with COM objects so they can be written in pure VBS or Js, or even hybrid batch-VBS/Js. For example pure VBS solution of the above:

Set oShell = CreateObject("Wscript.Shell")
Set oSFolders = oShell.SpecialFolders
WScript.Echo oSFolders("Desktop")

Hybrid batch/Js solution of the second snippet

@if (@CodeSection == @Batch) @then
@echo off
cscript //e:jscript //nologo "%~f0" %*
exit /b
@end

// JScript Section
WScript.Echo((new ActiveXObject("shell.application")).namespace(0x10).Self.Path);

From a batch file you can call PowerShell to get the path if you don't want the hybrid solution above

powershell -C "[Environment]::GetFolderPath([Environment+SpecialFolder]::Desktop)"

The "pure" batch solution is much trickier because you'll have to parse multiple registry keys

@echo off
setlocal EnableExtensions DisableDelayedExpansion

set "DesktopFolder="
for /F "skip=1 tokens=1,2*" %%I in ('%SystemRoot%\System32\reg.exe QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop 2^>nul') do if /I "%%I" == "Desktop" if not "%%~K" == "" if "%%J" == "REG_SZ" (set "DesktopFolder=%%~K") else if "%%J" == "REG_EXPAND_SZ" call set "DesktopFolder=%%~K"
if not defined DesktopFolder for /F "skip=1 tokens=1,2*" %%I in ('%SystemRoot%\System32\reg.exe QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Desktop 2^>nul') do if /I "%%I" == "Desktop" if not "%%~K" == "" if "%%J" == "REG_SZ" (set "DesktopFolder=%%~K") else if "%%J" == "REG_EXPAND_SZ" call set "DesktopFolder=%%~K"
if not defined DesktopFolder set "DesktopFolder=\"
if "%DesktopFolder:~-1%" == "\" set "DesktopFolder=%DesktopFolder:~0,-1%"
if not defined DesktopFolder set "DesktopFolder=%UserProfile%\Desktop"

echo Desktop folder is: "%DesktopFolder%"

endlocal
phuclv
  • 26,555
  • 15
  • 113
  • 235
2
  1. Copy the following code and save it in a .reg file.

    shell_folder_full_path.reg

    Windows Registry Editor Version 5.00
    
    ;Desktop
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{754AC886-DF64-4CBA-86B5-F7FBF4FBCEF5}]
    "ParsingName"=-
    
    ;Local Documents
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}]
    "ParsingName"=-
    
    ;Local Downloads
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}]
    "ParsingName"=-
    
    ;Local Music
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}]
    "ParsingName"=-
    
    ;Local Pictures
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}]
    "ParsingName"=-
    
    ;Local Videos
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}]
    "ParsingName"=-
    
  2. Run that .reg with Administrator Right.

  3. Restart Explorer.exe

Source: WinHelpOnline

Important: Note that the above workaround doesn’t help if:

  • You’ve redirected the shell folder(s) to OneDrive
  • You’re accessing the shell folder via This PC instead of Quick access
phuclv
  • 26,555
  • 15
  • 113
  • 235
Rexpert
  • 29
  • 2
  • Please read the Note in the source link above: **the above workaround doesn’t help if: - You’ve redirected the shell folder(s) to OneDrive;- You’re accessing the shell folder via This PC instead of Quick access** – phuclv Aug 05 '23 at 06:15
1

You can use this method to get the path to the desktop.

  1. right-click on the desktop file
  2. properties
  3. location

then you can copy the path.

The screenshot explains the steps:

image

bad_coder
  • 643
  • 1
  • 7
  • 16
0

It's hard to battle the Shell namespace. As a workaround, the following .reg file will add a context menu item to open the file system folder corresponding to a shell folder.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenFSFolder]
@="Open file folder (new window)"

[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenFSFolder\command]
@="explorer.exe \"%V\""

[HKEY_CLASSES_ROOT\Directory\shell\OpenFSFolder]
@="Open file folder (new window)"

[HKEY_CLASSES_ROOT\Directory\shell\OpenFSFolder\command]
@="explorer.exe \"%V\""

Keith Miller
  • 8,704
  • 1
  • 15
  • 28
0

Using %UserProfile%\Desktop reveals the Desktop path.

So I solved it with this Autohotkey script:

; Save Dialog: hitting CTRL D opens desktop
^d::
    ControlFocus, DirectUIHWND2, A
    SendInput, % "!d%userprofile%\Desktop{enter}!n"
return

OR:

; Windows explorer, hitting CTRL D goes to address bar and shows the full desktop path
#IfWinActive ahk_class CabinetWClass
    ^D::
        Send !D
        String := "%UserProfile%\Desktop"
        SendRaw %String%
        Send {ENTER}
        Send !D
    return
#IfWinActive

Hitting CTRL D does focus the address bar now and reveals the path.

Finally one Windows problem less

Avatar
  • 2,555
  • 4
  • 36
  • 50
  • as said, this is **wrong!** Users can change the paths easily. And if OneDrive backup is enabled (which is commonly the default in modern Windows) then the [paths to Documents, Desktop, Music, Pictures... will all be different](https://www.elevenforum.com/t/turn-on-or-off-onedrive-folder-backup-syncing-across-windows-11-devices.4321/) and **not in the user's home** – phuclv Jun 19 '23 at 01:51
-1

You can use right click-property on folder name, copy parent path then add the name of folder you want to access.

example

Cadoiz
  • 519
  • 3
  • 10
-1

After getting a new machine, I realize that in the explorer, I have a Desktop treeview item, in that I have a User treeview item, and inside the user treeview item, another treeview item that is called Desktop.

(I translated everything to English, maybe more simple to understand.)

In the first Desktop item, I have 33 entries. In the second one I have 9 entries.

All the methods that have been given here (I did not try via the register) give the path of the second Desktop item.

I should like to browse the first one in a winforms program, that does not appear simple.

For both items, the "Command line" item of the context menu opens to "C:\Users\User\Desktop".

The Properties command of the first one sends to the Parameters application of Windows. The Properties command of the second Desktop item gives a properties dialog box, with path "C:\Users\User\Desktop".

N.B. On this machine I did not access OneDrive yet. No trace of the desktop in the environment.

Maybe this helps to understand some of the difficulties met, and helps (or will help) to be more precise in the expression.

  • This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://superuser.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://superuser.com/help/whats-reputation), you can also [add a bounty](https://superuser.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/1157469) – Rohit Gupta Nov 19 '22 at 15:10
  • Please, do not search for another question. The question was just "How to find the real path of Desktop in Windows Explorer". This is exactly what I intended to do. – user3500176 Nov 19 '22 at 17:37
  • and how is it different from some other answers? – phuclv Jun 28 '23 at 00:45
-2

In windows 10, 2022, Desktop is placed in C:\User\username\Onedrive\Desktop

Edi
  • 1
  • 1
-2

To access the "hidden" (screen) desktop in Windows 10:
Double-click on "This PC".
Click on the "UP" arrow (up one directory level).

This will show all items on the primary desktop screen.

Tim
  • 1
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 16 '23 at 07:26
-2

Sorry I forgot this thread, the answer was given on another one. The two desktops are the user desktop, and the public desktop. Perhaps I should look in the APIs how to know the paths of both, but in a rather common configuration they are

C:\users\username\desktop
C:\users\public\desktop

In some contexts the user desktop is hosted elsewhere, for instance on OneDrive.

  • 2
    I don't understand how this improves anything against the existing answers. This is not a good answer. #1, the desktop can be anywhere the user sets. #2, I sincerely doubt that anyone except you has the user "username". If you intended that "username" is the name of the current user, then it doesn't get any closer to answering the question. %username% would have been better and %userprofile% better still but both are still incorrect. – Señor CMasMas Jun 29 '23 at 01:47
  • why on earth did you post 2 wrong answers in a single question? And did you even read other answers? Desktop in `Onedrive` is very common nowadays – phuclv Jun 29 '23 at 02:16