Questions tagged [dir]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
50 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]
0
votes
2answers
49 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:\...
0
votes
2answers
23 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 ...
0
votes
2answers
29 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 ...
0
votes
1answer
158 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 ...
0
votes
3answers
400 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 ...
-2
votes
1answer
128 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.
0
votes
2answers
196 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 ...
4
votes
2answers
708 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 ...
98
votes
2answers
10k 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....
9
votes
1answer
196 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 ...
0
votes
1answer
173 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 ...
0
votes
1answer
526 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 ...
1
vote
1answer
59 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)...
1
vote
1answer
89 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....
0
votes
2answers
90 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 ...
3
votes
2answers
338 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 ...
0
votes
0answers
57 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 ...
0
votes
1answer
1k 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 ...
1
vote
0answers
177 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 ...
2
votes
2answers
176 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 ...
0
votes
0answers
386 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 ...
1
vote
1answer
10k 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 ...
1
vote
3answers
2k 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 ...
1
vote
1answer
5k 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:\...
-1
votes
2answers
395 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....
1
vote
0answers
754 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 ...
1
vote
1answer
2k 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 ...
0
votes
1answer
880 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 ...
2
votes
1answer
3k 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?
1
vote
2answers
505 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 ...
1
vote
1answer
177 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 ...
0
votes
1answer
127 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 ...
63
votes
5answers
10k 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 ...
1
vote
1answer
121 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 ...
2
votes
0answers
693 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 ...
0
votes
1answer
43 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 ...
1
vote
2answers
508 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 ...
0
votes
1answer
195 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 ...
0
votes
2answers
325 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 ...
-1
votes
1answer
154 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 ...
0
votes
1answer
646 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 ...
0
votes
1answer
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?
1
vote
0answers
223 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 ...
27
votes
1answer
3k 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 ...
1
vote
2answers
1k 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,...
0
votes
1answer
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 ...
0
votes
1answer
78 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 ...
1
vote
0answers
303 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 ...
6
votes
2answers
1k 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 ...