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

5 votes
5 answers
8k 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 ...
Stefano Manolo Costantini Ragn's user avatar
0 votes
2 answers
3k 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 ...
user2989297's user avatar
1 vote
2 answers
280 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 ...
Synthetic Ascension's user avatar
22 votes
1 answer
77k 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 using explorer to C:\Windows\...
Lucas BS's user avatar
  • 482
0 votes
1 answer
795 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 ...
Our Man in Bananas's user avatar
1 vote
2 answers
2k 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 ...
Our Man in Bananas's user avatar
0 votes
1 answer
96 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 ...
coatless's user avatar
  • 171
0 votes
1 answer
4k 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/...
Jonathan Mee's user avatar
15 votes
5 answers
131k 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 ...
athos's user avatar
  • 2,321
1 vote
2 answers
15k views

Directory Listing includes Date Modified, File Size into text file/excel file

I want to list an entire drive's (Z:) directories, subdirectories, and files in a single text file with all the dates and the file sizes. I can then open the file inside Excel. I am currently using ...
Kurisuchin's user avatar
0 votes
1 answer
49 views

On Windows 7, how can I identify any folders that contain files that have not been updated in x years? [duplicate]

On Windows 7, how can I identify any folders that contain files that have not been updated in x years? I would like to clean up unused files/folders on network drives. Initially, I just need a list of ...
JLowery's user avatar
-2 votes
1 answer
536 views

DOS command-line query returns too many results

Can anyone tell me why dir *.asp returns all .asp files but also all .aspx files? It seems dir ignores extensions longer than three. This is really bugging.
Gary's user avatar
  • 1
0 votes
1 answer
51 views

How to find hard linked folders via programming

Is it possible to identify if a folder is actually a hard link created by mklink? I want to get folders and subsequent sub-folders. But hard linked folders drops me into a loop.
Mehrdad Ahankhah's user avatar
0 votes
2 answers
543 views

Command line to search for all word files using wildcards in filename

How can I find all files that have a name like ALPS*.doc in a folder like P:\Systems\A.L.P.S\? I tried this using the command line but it returns zero: Systems\A.L.P.S>dir /s /b c:\ |find /c "\...
Our Man in Bananas's user avatar
61 votes
9 answers
136k views

How to view all the Symbolic links, junction points, hard links in a Folder using dir?

The command dir /a displays a list of all the files and folders in a given location. But it displays the type <JUNCTION> for Junction Points as well as Symbolic Links to Folders. Is there any ...
Dhiwakar Ravikumar's user avatar
0 votes
1 answer
1k views

Dir command listing to show folder and file count, and directory size (no list)

I'm trying to get a basic count of a directory, but I do not want the result to list the names of the files contained in there. Basically, what I want would be the same as a Windows properties listing,...
NoHype's user avatar
  • 11
0 votes
1 answer
1k views

`DIR /B /O:N > filename.txt` but only showing folders without a certain file

I'm trying to make a list in XP of folders which do not contain a .jpg file. I use DIR /B /O:N > filename.txt for making a folder list. It works perfectly, but now I need a list where the folders ...
rai come's user avatar
0 votes
2 answers
2k views

Why does `rm -rf`` silently fail?

[EDIT] Please don't waste your time reading my question below. It turns out my colleague is an idiot.. :) On my server I'm trying to remove a folder and all its subfolders with the usual rm -rf ...
kramer65's user avatar
  • 1,424
-1 votes
2 answers
631 views

Find folders called SS, return size of folder

I am able to find all folders called "SS" (superseded) in a hierarchy and list out the location of each one. I have been using this code to pipe out the list. DIR /AD /B "SS" /S > SS_Folder_List.txt ...
RobN's user avatar
  • 1,692
5 votes
4 answers
10k views

dir folders at a certain folder depth in a batch file

I want, with a batch file, to be able to search and display the files in a bunch of folders called "error" located in a bunch of different places. The error folder is always at the same folder depth ...
Tomas's user avatar
  • 73
2 votes
3 answers
306 views

Obtaining a list of files from a specific directory

Many thanks for the help but... Using Windows 7 x64 running command from a batch file in a particular folder I use many paq8/paq9 command line compressors to back up my files. Of these, many can't ...
Steve Robathan's user avatar
0 votes
0 answers
681 views

How can I list all files recursively that have the compressed attribute set?

I started a decompress operation using compact /U /S /I /Q > compact-report.txt on a large dir (120GB+, ~950M+ files) and it has been going on for about 24 hours now. Most files seem decompressed, ...
Abel's user avatar
  • 1,483
1 vote
0 answers
49 views

I want the "apache" user to own a dir but other users are adding via WinSCP [duplicate]

This is a fairly simple problem to explain but it is really annoying me and I could do with some advice. How to I ensure that apache is user : group owner of a dir no matter who uploads to it.. the ...
user26676's user avatar
2 votes
2 answers
2k views

How can I use powershell to list all files I uploaded to server?

At work there's a network and everyone has a username and password that they use to log in. How can I search for my files on this network? I could list all the files like this: cd \\192.168.*.***\...
elisha's user avatar
  • 21
2 votes
1 answer
113 views

How can I create several folders?

How can I create several subfolders in folder in one command. For example, I want to create: /home/user/*create dir1*/*create dir2*/*create dir3*/ Provided, I don't have dir1. And I can't use 3 ...
bboybboy's user avatar
0 votes
2 answers
464 views

Windows Vista piping dir output into attrib command

I had a virus or something on my computer that set the attributes for all the folders in the root of my external drive to system and hidden, and created shortcuts to them. I am now trying to remove ...
user avatar
3 votes
1 answer
10k views

CMD Using DIR to order directories by name

I'm using the following command to list files including those in sub-directories ordered by name. dir /b/s/on The files are correctly ordered within their given directories but the directories are ...
Paul Fleming's user avatar
1 vote
1 answer
700 views

List files in CMD with DIR

I'm trying to use DIR to list all files in the current directory and sub directories ordered alphabetically. I only care about the filepath and name. I don't want the size, counts, etc. Here's what I ...
Paul Fleming's user avatar
5 votes
8 answers
406 views

DIR filenames that contain extensions

I was just trying to check a dump-directory for any ZIP programs like PeaZip, NanoZip, etc. and ran into an odd problem that I have seen only a few times before. I used the following command to list ...
Synetech's user avatar
  • 69k
2 votes
1 answer
196 views

Why does "dir *.*~" list files in a way different to what is expected?

In my directory I have the files files x.dll x.lib x.pdb x.exp x.plugin When I issue the command dir \*.*~ it should say 'File not found' as it does at my friend's laptop. But on my machine it ...
rezna's user avatar
  • 201

15 30 50 per page