Question:
What's the DOS command prompt to list all files on WinXP?
ladyfiresweetflower
2012-07-20 13:47:57 UTC
I want a list of all the files on my desktop. I've been trying to use the command prompt to do it, but for some reason it's not working. I think it might not like spaces in the path name or something.

This is a PC with XP.

My desktop directory is c:\documents and settings\(username)\desktop

What do I need to type in the command prompt box to get a list of all the files?
Three answers:
?
2012-07-20 14:44:21 UTC
dir /A-D /B "%USERPROFILE%\Desktop"

The /A-D excludes directories/Folders

If you want files in folders on your desktop listed, use /S

dir /S /B "%USERPROFILE%\Desktop"
realm174
2012-07-20 20:56:49 UTC
Any DOS command where (for example) you have a space in the directory can be accomplished by using double quotes. For example, you could do this:



dir "c:\documents and settings\(username)\desktop"
Phil G
2012-07-20 20:50:01 UTC
dir %USERPROFILE%\Desktop



if you just want the file names then try



dir /b %USERPROFILE%\Desktop


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...