Skip to main content
The 2024 Developer Survey results are live! See the results

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
302 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
654 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
4k 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
9k 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
691 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
  • 210
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
652 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
952 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
392 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.4k
1 vote
1 answer
347 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
2 votes
0 answers
1k views

How to count total pages of multipile word files using dir command?

I have folder with about 1,000 MS-word files. Apart from Name, Size and Type column, I have "Pages", which is show me how many pages each file contains. How do I count how many pages I have in my ...
Adam's user avatar
  • 61
0 votes
1 answer
48 views

Unable to view hidden directories although I am able to see hidden folders/files

I store a backup of my music in an external HDD, G:. The main location is in E:. Although both folders have exactly the same folder structure and songs/album artworks, the main location has 6 more ...
AQUATH's user avatar
  • 1
1 vote
2 answers
618 views

How to run default dir command under FAR file manager?

I have Cygwin installed somewhere in the path. So I have >where dir D:\Users\Dims\Design\Cygwin64\bin\dir.exe When I run DIR from CMD I get the normal Windows DIR: >dir /? Displays a list of ...
Dims's user avatar
  • 12.8k
0 votes
1 answer
208 views

Folder attributes lost on copy or move in Windows 10 1607 (Anniversary Update)

Windows 10 1511 Make copy of folder with attributes +R/+S on same partition - Copy has same attributes set Make copy of folder with attributes +R/+S on different partition - Copy has same attributes ...
Robert's user avatar
  • 1
0 votes
2 answers
2k views

Windows Command Prompt Dir Command to Save Text file and have no extentions in the data?

I have a Dir Command I use to make a text list of a directory of files.. "dir /a /b /-p /o:gen > z-file_list.txt" Dose anyone know how I can change this so the text list dose not contain any ...
aJynks's user avatar
  • 131
-1 votes
1 answer
166 views

In Bash, how to test if there is a directory with the given path?

I have the following bash code: drlist="/backups /Blogs /data /dpkg-repack /Scripts /var/www"; for word in $drlist; do echo $word; done What I need to do is test to see if the $word exists as a ...
OldManRiver's user avatar
0 votes
1 answer
1k views

How do I search for files containing a range of numerics using windows DIR command?

I want to be able to isolate and search using the windows DIR command for only the files that contain an extra numeric at the end. How do I do this? I have attached a picture that shows an example ...
Dr. Dan's user avatar
  • 103
0 votes
1 answer
2k views

What is the point of the .trashes file in Mac Os X?

What is the point of the '/.trashes' file in Mac Os X? It appears to be useless. I've never seen it being used by programmers. Would it be bad to delete it?
John Militer's user avatar
1 vote
0 answers
409 views

Windows DIR analogue of ls -v

In linux, ls -v returns a file list in a "natural sort" order -- that is, when the name has a numerical part, it is sorted as a number: file1.txt file2.txt file11.txt Is there a way to ...
laxxy's user avatar
  • 111
27 votes
1 answer
4k views

Non-hidden directory doesn't show in Explorer, but the program that made it can access it

I'm using IMAPSize to backup my mailboxes. The process just dumps the contents of your mailbox into .eml files on your disk. Anyway, the first mailbox I backed up shows up as I expect. However, the ...
Xophmeister's user avatar
1 vote
2 answers
2k views

Listing folders in CMD which does NOT have a specific subfolder

I've an issue where i need to locate all folders on a drive which does NOT have a folder in them called "Arg".. I know how to do it in reverse using DIR, i.e to find all subfolder with a specific name,...
Aryat Mapreh's user avatar
1 vote
1 answer
3k views

VBA in Excel 2013, Loop through files where the wildcard applies to the subdirectory

I have a MATLAB script that analyzes experimental results on a number of widgets my company makes, and finally exports the summarized data into a CSV file. I want to import all of these csv files into ...
cbcoutinho's user avatar
0 votes
1 answer
85 views

Windows DIR command searches folders it shouldn't

I'm trying to create a batch file that searches certain folders on our server for JPGs and creates a txt file with them. It works fine BUT for some reason it always adds a folder to the end of the ...
NVNM's user avatar
  • 1
1 vote
0 answers
343 views

Different date stamps Explorer vs. from command line - Win7

I'm trying to create a simple batch file to match up 2 directories of files to resolve some issues between the 2 sets. This would be very easy to do if I could match them between directories based ...
Gene T's user avatar
  • 11
6 votes
2 answers
2k views

How to make AppData directory appear in File Explorer?

This post outlines how to make the AppData directory show up at the DOS prompt, but how do I make it show up in File Explorer (on Windows 7 Home Premium 64-bit)? Is there a global setting? Also, what ...
Jordan Jamingsons's user avatar

15 30 50 per page