0

I've been trying to point to files and directories via my command line or powershell in windows, but for whatever reason the dir or ls command will not display files or folders within the directory outside of the root directory. To demonstrate:

Here it works fine

Here is my Desktop in the GUI

But here is my Desktop again in the command line

How can I fix this so that files are displayed again?

1
  • Your second image (File Explorer?) says that it is displaying OneNote > Desktop.    Have you tried dir OneNote\Desktop?   Or cd OneNote followed by dir Desktop? Commented Dec 28, 2018 at 2:48

1 Answer 1

1

The files you see on your desktop in the GUI are probably in the default profile. These icons will be visible for all users of the machine, but don't exist in the individual users' desktop folder.

Two tests you could do to confirm this...

Create a new file on your desktop, then re-run dir and confirm that it is visible.

Within the command prompt, change to the default profile directory by runnning the commands:

cd c:\Users\default\desktop
dir

Which should show the items in your original GUI screencap.

8
  • @n8te My understanding was that shortcuts should appear as .lnk files, and lack of them in screen cap #3 but visibility in the GUI would suggest they are located somewhere else. Has this changed in Windows 10?
    – v25
    Commented Dec 28, 2018 at 2:31
  • You're right. My mistake.
    – n8te
    Commented Dec 28, 2018 at 2:34
  • If I make a new directory or file in cmd, it will show up on subsequent dir commands in said directory, but anything pre-existing it does not. Nothing shows up in the “default” desktop directory you mentioned, either
    – Negimaki
    Commented Dec 28, 2018 at 3:03
  • 1
    @negimaki try c:\Users\Public\Desktop instead? Or infact, further to what Scott pointed out in another comment, these shortcuts you see may exisit in C:\Users\[Your User Account Name]\OneDrive\Desktop
    – v25
    Commented Dec 28, 2018 at 3:09
  • Weird. That last command DID work with cd and then for, but Desktop did not show up under dir. Hidden directories? Is this normal functioning?
    – Negimaki
    Commented Dec 28, 2018 at 3:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .