Skip to main content

Questions tagged [dir]

for questions related to the `dir` command, which lists directory contents in MS-DOS and Windows-based operating systems

1 vote
1 answer
470 views

Powershell shortcut to list all files and folders (including hidden files) and order them by date

I'm basically looking for something like ls -alt, but in Powershell (Windows 11). Currently I'm using gci -fo | sort LastWriteTime -Descending but it's a bit of a doozy, and definitely not easy to ...
DeltaIV's user avatar
  • 437
1 vote
1 answer
279 views

How to get last modification date timestamp in "DIR /S /B" result?

In the early days of Windows (3.1, Windows 95) there was a wonderful feature, called "Find", which could be used for finding files on your computer. Some *** has decided to remove this ...
Dominique's user avatar
  • 2,281
1 vote
0 answers
55 views

How to differentiate between directories created manually and directories created by installed programs?

On my Ubuntu laptop, I want to differentiate between directories I created manually and directories created by programs that I install for coding purposes (in Python). I have searched a lot, but it ...
selmanioui's user avatar
1 vote
2 answers
183 views

Show only folder name with the link information via Windows DIR

How can I get only folder and its symbolic link information output via dir? What I want is this, where CNET and projects are symbolic links: CNET [\\192.168.1.10\CNET] elements localized projects [\\...
andio's user avatar
  • 293
1 vote
1 answer
321 views

dir /ta for displaying last-access times sometimes shows last-write times instead

On my Windows 11 22H2 system, I've verified that that last-access timestamps are maintained (fsutil behavior query disableLastAccess), and in PowerShell they can be retrieved. However, with cmd.exe's ...
mklement0's user avatar
  • 2,110
1 vote
2 answers
486 views

Powershell equivalent of "dir /a"?

Running dir /a on a given directory on one of our servers produces a list of unexpected files that look like malware: C:\Users\<username>dir /a c:\Users\Public\Downloads\ Volume in drive C has ...
kindzmarauli's user avatar
3 votes
1 answer
8k views

rmdir favorites Access is Denied

Command prompt: CD C:\Users\Example\ rmdir favorites Access is denied. How do I delete the Favorites folder via the command prompt? Yes, I want to do this. Yes, I know this folder is for Internet ...
John's user avatar
  • 2,147
0 votes
0 answers
147 views

What does [...] mean for Reparse Point Target when dir /al is executed

When I execute dir \al (Attribute: Reparse Points), I get a result that lists reparse points. The following output is easy enough to understand with columns being Date Modified, Time Modified, Dir ...
mak's user avatar
  • 121
3 votes
2 answers
7k views

What's the easiest way to map "ls" to the "dir" command in Windows? [duplicate]

I've found a few posts on command line aliases in Windows but most of them relate to aliasing long cd commands/paths that are frequently used and I can't make them work for my needs. In my case, I ...
RLH's user avatar
  • 4,515
1 vote
2 answers
7k views

Rename command in dos

this is my first question here. I just revived an old pc to play dos games. I couldn't rename a folder, but I can rename files. Any idea why? Q2: How to see the full folder name in dir command? I see ...
noname delete's user avatar
1 vote
2 answers
2k views

How to get the only the total files size from folders in windows commandline

How to get the only the total files size from folders dir in windows commandline [self answered]
Robin's user avatar
  • 23
0 votes
2 answers
3k views

List each subdirectory and the number of files within it using cmd.exe

I have several subdirectories that contain files, and I want to list each subdirectory and beside it the number of files (*.html specifically) within that subdirectory. For example, I am in "C:\...
JAT86's user avatar
  • 211
0 votes
1 answer
1k views

Can I get a list of media files duration using something like DIR?

I'm at folder Music, all right? and let's say I want to know the name and other attributes of every song in that directory, then I'll just open a terminal and go dir > musicFiles.txt but that ...
newbie's user avatar
  • 207
0 votes
2 answers
324 views

Windows cmd dir hogging CPU

I have a couple of these "Windows command Processor" (cmd) running a dir command and taking 10-15% CPU constantly, heating everything up and well hogging CPU. I also see findstr running ...
Kashyap's user avatar
  • 101
1 vote
1 answer
1k views

Default files sort order used by "dir" command / core Windows 10

tl;dr I cannot replicate sort order used by dir command in Windows 10, neither within File Explorer nor Total Commander. I have tried to change sort order based on many different columns and still ...
trejder's user avatar
  • 11.4k
1 vote
3 answers
6k views

Windows command dir lists files with absolute path, relative path required

I would like to list all filesnames of all files with a specific extension in a directory structure and write this to a file. What I have reached: dir /B /S *.ext > list.filenames This gives me a ...
Teddy's user avatar
  • 163
-2 votes
1 answer
186 views

How do I use the command line to search for multiple characters at the same time?

Write a DOS command to display all files on drive C: whose filenames are 7 characters long and begins with the letters CHAR.
Golden Boy's user avatar
0 votes
2 answers
213 views

Windows7 command prompt show number of objects as list from dir command

I'm using Windows7, and I want to know the number of files (or objects) for comparison to objects in Amazon S3 buckets. I'm not interested in size, as the size can differ between file types. I want ...
Jordan's user avatar
  • 1
5 votes
2 answers
3k views

How can I output a list of filenames surrounded by quotation marks?

In Windows Command Prompt, I can use the dir command to output the names of all PNG files within a directory: dir *.png /od /b > files.txt file 1.png file 2.png ... However, the image files I am ...
deanff's user avatar
  • 75
97 votes
2 answers
11k views

Why is DNS apparently involved in issuing "dir" on Windows 10?

For complicated reasons, I have been forced to make an identical copy of cmd.exe and rename it to cmd-2.exe, which I put as a shortcut on the Taskbar to have them "grouped" in different taskbar groups....
Khalid's user avatar
  • 739
9 votes
1 answer
220 views

Understanding why the DIR command behaves this way

Why does: dir "test.txt " dir test.txt. dir "test.txt . . ." all lists test.txt with no error on Windows prompt? Are there any other suffix that are ignored by Windows? (please note that I ...
Guillaume's user avatar
  • 193
0 votes
1 answer
359 views

Why would the DIR command not be working for the documents folder in CMD?

Why would it be that I can't list the contents of the documents directory, but it works for every other folder. It is behaving like I accessed the special folder "My Documents", but I didn't. The ...
inari's user avatar
  • 1
0 votes
1 answer
2k views

Windows 10 Command Prompt - List all files and folders inside a directory without displaying file extensions

I've been using dir /b to display all files and folders in a directory but it includes the file extension for every file in a directory. What is the command for displaying all files without including ...
Denzell's user avatar
  • 121
1 vote
1 answer
577 views

Dir piped into Set

Im trying to make a program that selects a file name, then pipes it into a variable. My Attempt: Dir /B "C:\Program Files (x86)\ServerMaster\Internals\Versions\Van1" | (set /p myVar= & set myVar)...
Brennan Olson's user avatar
1 vote
1 answer
216 views

DIR command reporting incorrect files

Behold below command and actual feedback. C:\Temp\AEAPI> dir apb*.* Volume in drive C is XXXXXXXX Volume Serial Number is XXXX-XXXX Directory of C:\Temp\AEAPI 01/08/2009 07:24 9....
tee's user avatar
  • 21
0 votes
2 answers
238 views

What is wrong with this Batch file

e: cd \My Files dir a:\ >\Prt2Txt\adrv1.txt\ pause results in: E:\My Files>nhm E:\My Files>e: E:\My Files>cd \My Files E:\My Files>dir a:\ 1>\Prt2Txt\adrv1.txt\ The system ...
Neil Murphy's user avatar
3 votes
2 answers
1k views

DIR command that ignores files with multiple extensions

I have a directory containing a single .exe that I need to find using DIR. However, I also have files in the same directory that end in .vshost.exe. I always end up with both files matched to my *.exe ...
610163's user avatar
  • 33
0 votes
0 answers
68 views

How can I easily open a command prompt in current folder with /u (set to unicode output)?

I'm trying to output directory and .txt file names using the following: dir /b /s /a:d >> "filenames.txt" dir /b /s *.txt >> "filenames.txt" But some of the file and directory names use ...
BurrowDeck's user avatar
0 votes
1 answer
3k views

dir / ls not displaying files outside of root directory in Windows 10

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 ...
Negimaki's user avatar
1 vote
0 answers
294 views

Laravel issue __DIR___ [closed]

Notice: Use of undefined constant DIR - assumed 'DIR' in /home/flamore/domains/fans.cal24.pl/public_html/index.php on line 21 Warning: require(DIR/../laravel/bootstrap/autoload.php): failed to open ...
Krzysztof J's user avatar

15 30 50 per page