Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
0
votes
1answer
28 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
53 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
27 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)...
0
votes
0answers
27 views

Using the dir command in a cmd window, results are not correct/as expected

Have a directory C:\...platform-tools, contents include abd.exe. dir lists all the files in the directory. dir a* list all files in the directory starting with the letter a. dir ab* results in File ...
1
vote
1answer
38 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
74 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
58 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
50 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
293 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
116 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 ...
1
vote
1answer
76 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
84 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
3k 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
2answers
154 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
2k 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
194 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
165 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
0answers
992 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
129 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 ...
0
votes
1answer
1k 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
173 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
65 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 ...
1
vote
0answers
66 views

Dir listing including created date

I use dir *.epub /b /s > listepub.txt to get a list of books in my ebook library. I would like to add the created date to the list, anyone can help ?
0
votes
1answer
60 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
5answers
9k 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
61 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
469 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
42 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 ...
0
votes
1answer
338 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
175 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
112 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
142 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
308 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
1k 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
147 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 ...
26
votes
1answer
2k 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
837 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
2k 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
52 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
266 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 ...
4
votes
1answer
790 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 ...
5
votes
5answers
5k views

Copy file names with a certain number of characters in command line (CMD)

I need to copy all text files on one folder whose names are five characters long. I know this command is for listing: $ dir folder /B | findstr /R "^.....\.txt" but I want to copy all files whose ...
0
votes
2answers
545 views

dir /s not returning ALL subdirectories

I need a list of all files and folders in a giant directory. This ends up being approximately 1000 folders and 20000 files. Being a command line noob, I started out just by doing "dir>file.txt" while ...
1
vote
2answers
215 views

Powershell: Dir /s - Remove Repeated Folders

Situation: In Powershell, I'm using: $folders = dir -s C:\Users\Name\Downloads\*.ttf | Select Directory foreach ($folder in $folders) { echo $folder } To display folders whose contents contain ...
14
votes
1answer
43k views

How to change CMD start directory [duplicate]

I want to change the CMD startup directory when I launch it via Start+R Currently, it points to my users folder. I need it to point to C:\Windows\System32\ When I navigate manually to C:\Windows\...
0
votes
1answer
520 views

How to stop DIR command counting “Thumbs.db”

We have a process that executes a DIR on multiple folders to check that the correct documents have been generated by another process. In each of the target directories we use this command: dir /A:-D ...
1
vote
1answer
982 views

Dir command not working on one UNC Share

We have a process that runs in SQL Server which executes a DIR command on the local network using a UNC path to check that the files generated by another system are all there, as part of an audit ...
0
votes
1answer
44 views

List files in cmd.exe numerically by default to generate a gif out of a sequence of frames

Greetings and Salutations All, I'm trying to create an animation using imagemagick via: convert -delay 80 -loop 0 *.png ani.gif The logic is finding all the .png files, except the file names are ...
0
votes
1answer
2k views

Is there a Window's Command Line Option to Show the Sizes of Directories

When I do a dir command it, gives this information: 02/11/2015 01:39 PM <DIR> bar 11/11/2014 07:22 AM <DIR> buz 02/12/2015 01:35 PM 140,660,736 foo.sdf 01/...
9
votes
4answers
82k views

windows command line dir command: to display only the file name, in 8.3 format?

I know that "dir /w" or "dir /b" shows only the file name. While "dir /x" or "dir /X" shows the 8.3 format, but together shows all other information like long format file names, dates and size. is it ...