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

2 votes
2 answers
300 views

Exclude system entries with "ls" or "find"

Compare Cygwin: $ ls -1 -N /cygdrive/c $Recycle.Bin cygwin64 Documents and Settings pagefile.sys PerfLogs Program Files Program Files (x86) ProgramData Recovery System Volume Information Users ...
Zombo's user avatar
  • 1
0 votes
0 answers
651 views

Wildcard behavior in Windows DIR to show files in multiple subdirectories

I want to list files under both the Local and LocalLow directories under C:\Users\USERNAME\APPDATA but when I use the following command: dir /s c:\users\me\appdata\Loca* it only shows items ...
user30197's user avatar
2 votes
1 answer
17k views

Batch File, dir | findstr within a for loop

Let me preface by admitting that I am a complete noob at batch files... and programming language in general. I am trying to write a batch file that allows the user to input a partial filename, and it ...
Gumbi's user avatar
  • 23
1 vote
3 answers
3k views

Get files sorted without extension in batch

I would like to have an option to get all the files in the folder, just the names (no path and no extension) and sorted by name, in a simple batch file. I know how to get all the names, but it's not ...
user2254436's user avatar
3 votes
1 answer
8k views

How to not show file path with dir /b /s command in batch file

Is there Any way I can bypass displaying file paths when using the dir /b /s command into a file? Currently, when I run dir /b /s C:\WinPE_amd64 >dir.txt it outputs something like this: C:\...
Mark Deven's user avatar
  • 1,660
-1 votes
2 answers
670 views

How to print contents of a directory and save it NOT in the directory?

I have a folder which freezes the whole system when I open it (probably there is a corrupted file). Luckily, I'm just interested in the names of the files in the folder. So, how do I create a dirlist....
RichardTheCoder's user avatar
1 vote
0 answers
1k views

How to get files ordered by name with `dir`?

This used to be really easy in the old OS's. dir /o:n >> list.txt for %a in (`list.txt`) do copy %a ..\ordered And voila, there was the list of files in the other folder, created in the sorted ...
Alex's user avatar
  • 198
1 vote
1 answer
3k views

Why does Windows DIR command produce ??? characters instead of Russian alphabet?

On a Windows 10 box, via command line, I run this command: C:\Users\idiot\Music>dir /a:d /s /b >> tom-music-2016-july.txt The purpose is to list all directories. But I notice that directories with ...
rjnagle's user avatar
  • 294
0 votes
1 answer
4k views

Searching for files within a number of folders in command line in Windows 10

I'm trying to find the proper syntax for finding all the files with a specific name that are in a multitude of folders. So - I have a directory with 100+ folders, in each folder there are files that ...
Sam's user avatar
  • 11
4 votes
1 answer
5k views

DIR shows file sizes in parentheses

On some server, I noticed that the CMD DIR command showed some file sizes between parentheses. What does that mean?
Michel de Ruiter's user avatar
1 vote
2 answers
651 views

How do I search for non-hidden files in hidden subfolders using Windows Command Line

Looking through Google and super user stack exchange showed me how to search a folder and it's subfolder for hidden files dir /A:H /S testHiddenFile*.txt or hidden folders: dir /A:HD /S testFolder ...
Ash's user avatar
  • 111
1 vote
1 answer
935 views

How do I get a list of the fullpaths of every .git subfolder in a directory tree?

I am unable to figure out the right set of commands in a Windows Command prompt FOR /? or bash ls to do this. The following batch file I wrote demonstrates what I want, but I would like to know if ...
Daisha Lynn's user avatar
0 votes
1 answer
389 views

DIR list files with only one extension

The code below will list all files from the selected directory. How to make it list only files with one extension, like pdf? [HKEY_CLASSES_ROOT\Directory\Shell\4_content-list-pdf\command] @="cmd /c ...
Rayearth's user avatar
  • 355
62 votes
5 answers
11k views

Why does `dir *.*` give me all files and folders?

When I run dir *.* it produces unexpected results. Even files and folders without any dot in their names are listed. For example C:\>dir *.* Volume in drive C is System Volume Serial Number is ...
phuclv's user avatar
  • 28.3k
1 vote
1 answer
344 views

How can I keep the dir command date/time from changing?

I created a directory listing (text file) with a dir command 3 months ago. The files haven't changed since then. Now, a listing of the same files shows every file with a timestamp exactly one hour ...
FreonPSandoz's user avatar

15 30 50 per page
1 2
3
4 5
8