Skip to main content

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
279 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
794 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
95 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,301
1 vote
2 answers
14k 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
522 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
534 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
135k 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

15 30 50 per page
1
4
5
6 7 8