Questions tagged [dir]
for questions related to the `dir` command, which lists directory contents in MS-DOS and Windows-based operating systems
109
questions
1
vote
2
answers
144
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 ...
3
votes
1
answer
3k
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 ...
0
votes
0
answers
99
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 ...
2
votes
2
answers
2k
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 ...
0
votes
2
answers
2k
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 ...
1
vote
2
answers
1k
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
2
answers
903
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
1
answer
800
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
2
answers
71
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 ...
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 ...
0
votes
3
answers
4k
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
1
answer
169
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
2
answers
202
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
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 ...
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....
9
votes
1
answer
213
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
1
answer
313
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
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 ...
1
vote
1
answer
322
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
1
answer
189
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
2
answers
148
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
2
answers
859
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
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 ...
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 ...
1
vote
0
answers
286
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
2
answers
270
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
0
answers
572
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 ...
2
votes
1
answer
15k
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
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 ...
1
vote
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:\...
-1
votes
2
answers
488
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
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 ...
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 ...
0
votes
1
answer
2k
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 ...
3
votes
1
answer
4k
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
2
answers
593
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
1
answer
728
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
1
answer
266
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 ...
62
votes
5
answers
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
1
answer
234
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
0
answers
904
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
1
answer
45
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
2
answers
583
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
1
answer
206
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
2
answers
1k
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
1
answer
160
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
1
answer
997
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
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?
1
vote
0
answers
331
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
1
answer
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 ...