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?

  • 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? – Scott Dec 28 '18 at 2:48
0

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.

  • @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 Dec 28 '18 at 2:31
  • You're right. My mistake. – n8te Dec 28 '18 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 Dec 28 '18 at 3:03
  • @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 Dec 28 '18 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 Dec 28 '18 at 3:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.