{"id":4633,"date":"2026-03-26T06:15:00","date_gmt":"2026-03-26T05:15:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=4633"},"modified":"2023-09-05T16:33:30","modified_gmt":"2023-09-05T14:33:30","slug":"list-files-in-folder-with-cmd","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/","title":{"rendered":"How to list files in a Windows folder with cmd?"},"content":{"rendered":"\n<h4 class=\"wp-block-heading has-text-align-left\"><strong><em>How to list all the files in a Windows folder using ms-dos commands?<\/em><\/strong><\/h4>\n\n\n\n<p>When it comes to List files in a huge folder with cmd in Windows, it&#8217;s highly recommended, even mandatory. Indeed, use scripting to avoid a tremendous manual work and errors. Automation is key here, with very simple bash commands windows system can do all the work.<\/p>\n\n\n\n<p>Indeed, the dir command in MS-DOS is a fundamental tool for managing and organizing files in Windows. It can be used to list all files in a folder, including their attributes such as creation date, type, size, and name. With a few simple options, you can filter and sort the results, making it easier to find the specific files you need. In addition, the dir command can be used to search for files in subdirectories, display files with specific extensions, and show only hidden, read-only, or system files.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#1-list-all-the-files-in-a-folder-with-ms-dos\" >1. List all the files in a folder with MS-DOS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#2-advanced-options-to-list-files-using-the-dir-command\" >2. Advanced options to list files using the dir command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#3-example-of-scripts-using-the-dir-with-cmd-to-list-files\" >3. Example of scripts using the dir with cmd to list files<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#31-display-files-with-specific-attributes\" >3.1 Display files with specific attributes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#32-search-for-files-inside-subdirectories\" >3.2 Search for files inside subdirectories<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#33-display-files-with-a-specific-extension-with-ms-dos\" >3.3 Display files with a specific extension with ms-dos<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#34-combine-dir-options-with-ms-dos\" >3.4 Combine dir options with ms-dos<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-1-list-all-the-files-in-a-folder-with-ms-dos\"><span class=\"ez-toc-section\" id=\"1-list-all-the-files-in-a-folder-with-ms-dos\"><\/span>1. List all the files in a folder with MS-DOS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Use the <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows-server\/administration\/windows-commands\/dir\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">dir<\/a> command line to display the full list of files inside a specific directory. To display the list of files with some attributes, use the dir command. The default <a href=\"https:\/\/encyclopedia2.thefreedictionary.com\/file+attribute\" target=\"_blank\" rel=\"noreferrer noopener\">attributes<\/a> are the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>The creation date and time.<\/li>\n\n\n\n<li>The type, if &lt;DIR&gt; is displayed then it is a directory, if not it is a file.<\/li>\n\n\n\n<li>The size of the files, in bytes.<\/li>\n\n\n\n<li>The name of the folder or the file with the extension, like for example file.txt.<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bat\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">dir<\/pre>\n\n\n\n<p>The command also lists the total number of files in the folder and the total size. And also the total number of folders and the free disk space available in the current drive in bytes. <strong>Please note the dir command without options do not display the hidden files nor the windows system files.<\/strong><\/p>\n\n\n\n<p>Of course it is also possible to copy Windows files recursively, i.e., <a href=\"https:\/\/expert-only.com\/en\/ms-dos\/copy-files-recursively-with-cmd\/\">copy all files from a folder and its subfolders<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-sql-and-it-tutorials wp-block-embed-sql-and-it-tutorials\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"HTqS7pX5d8\"><a href=\"https:\/\/expert-only.com\/en\/ms-dos\/copy-files-recursively-with-cmd\/\">How to copy files recursively using Windows cmd?<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;How to copy files recursively using Windows cmd?&#8221; &#8212; SQL and IT Tutorials\" src=\"https:\/\/expert-only.com\/en\/ms-dos\/copy-files-recursively-with-cmd\/embed\/#?secret=i1Lzj22hZU#?secret=HTqS7pX5d8\" data-secret=\"HTqS7pX5d8\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2-advanced-options-to-list-files-using-the-dir-command\"><\/span>2. Advanced options to list files using the dir command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The <code>dir<\/code> command provides various advanced options that you can use to filter and display specific files, such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/A<\/code> &#8211; Display only files with specific attributes (e.g. <code>\/AH<\/code> to display only hidden files)<\/li>\n\n\n\n<li><code>\/B<\/code> &#8211; Display files in bare format (without additional details like the size or date modified)<\/li>\n\n\n\n<li><code>\/S<\/code> &#8211; Search for files in subdirectories as well<\/li>\n\n\n\n<li><code>\/W<\/code> &#8211; Display files in a wide format (multiple columns, instead of a single column)<\/li>\n\n\n\n<li><code>*.ext<\/code> &#8211; Display only files with a specific extension (e.g. <code>dir *.txt<\/code> to display only .txt files)<\/li>\n<\/ul>\n\n\n\n<p>Of course you can combine these options together to achieve more specific results. For example, <code>dir \/A \/S \/W *.txt<\/code> will search for all .txt files in the current directory and its subdirectories, display them in a wide format, and show only files with specific attributes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3-example-of-scripts-using-the-dir-with-cmd-to-list-files\"><\/span>3. Example of scripts using the dir with cmd to list files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>One of the key benefits of the dir command is its versatility. By combining options, you can create complex queries to display only the files you need, saving time and reducing manual effort. This is especially useful when dealing with large directories.<\/p>\n\n\n\n<p>Indeed, scrolling through a long list of files is time-consuming and can lead to manipulation errors. The basic examples presented below illustrate how the options are useful.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"31-display-files-with-specific-attributes\"><\/span>3.1 Display files with specific attributes<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>This code will display all files with specific attributes. You can use the following options to filter the results:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/AH<\/code> &#8211; Display only hidden files<\/li>\n\n\n\n<li><code>\/AR<\/code> &#8211; Display only read-only files<\/li>\n\n\n\n<li><code>\/AS<\/code> &#8211; Display only system files<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bat\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">dir \/A<\/pre>\n\n\n\n<p><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"550\" src=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/cmd-list-files-in-folder-dir-a-1.jpg\" alt=\"How to list files in a folder with cmd?\" class=\"wp-image-26707\" srcset=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/cmd-list-files-in-folder-dir-a-1.jpg 740w, https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/cmd-list-files-in-folder-dir-a-1-300x223.jpg 300w\" sizes=\"auto, (max-width: 740px) 100vw, 740px\" \/><figcaption class=\"wp-element-caption\"><em>How to list files in a folder with cmd?<\/em><\/figcaption><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"32-search-for-files-inside-subdirectories\"><\/span>3.2 Search for files inside subdirectories<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>This code will <a href=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-recursively-with-cmd\/\">search for files in the current directory and its subdirectories<\/a> and display the results.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bat\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">dir \/S<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"33-display-files-with-a-specific-extension-with-ms-dos\"><\/span>3.3 Display files with a specific extension with ms-dos<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The following ms-dos script display all files with a specific extension, here it is .csv. Replace <strong><code>*.<\/code>csv<\/strong> with the extension you want to search for (e.g. <code>*.txt<\/code>, or *.jpeg to display only .txt files or JPEG pictures, respectively).<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bat\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">dir *.csv<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"34-combine-dir-options-with-ms-dos\"><\/span>3.4 Combine dir options with ms-dos<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>This sample command search for all .txt files in the current directory and its subdirectories, display them in a wide format, and show only files with specific attributes.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"bat\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">dir \/A \/S \/W *.txt<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Conclusion on listing Windows files using cmd<\/h4>\n\n\n\n<p>The <strong>dir command<\/strong> in MS-DOS is a powerful tool to manage and <strong>list files in a Windows folder with cmd<\/strong>. With a few simple options, you can display a list of all files in a folder, including their <strong>creation date<\/strong>, <strong>type<\/strong>, <strong>size<\/strong>, and <strong>name<\/strong>. You can also search for files in subdirectories and display files with specific attributes, such as hidden or read-only files.<\/p>\n\n\n\n<p>By combining multiple options, you can filter the results even further, such as displaying only .txt files in a wide format with specific attributes. Whether you&#8217;re looking to automate a tedious manual task or simply get a better overview of the contents of a directory, the dir command is an essential tool for anyone working with Windows command lines.<\/p>\n\n\n\n<p><strong>To go further, this is a tutorial on <a href=\"https:\/\/expert-only.com\/en\/ps\/copy-files-recursively-in-powershell\/\">how to copy files recursively in PowerShell<\/a>.<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-embed aligncenter is-type-wp-embed is-provider-sql-and-it-tutorials wp-block-embed-sql-and-it-tutorials\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"gPlDxSe1FE\"><a href=\"https:\/\/expert-only.com\/en\/ps\/copy-files-recursively-in-powershell\/\">How to copy files recursively in PowerShell using Copy-Item?<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;How to copy files recursively in PowerShell using Copy-Item?&#8221; &#8212; SQL and IT Tutorials\" src=\"https:\/\/expert-only.com\/en\/ps\/copy-files-recursively-in-powershell\/embed\/#?secret=RHD6gGkqwx#?secret=gPlDxSe1FE\" data-secret=\"gPlDxSe1FE\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>How to list all the files in a Windows folder using ms-dos commands? When it comes to List files in a huge folder with cmd in Windows, it&#8217;s highly recommended, even mandatory. Indeed, use scripting to avoid a tremendous <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/\" title=\"How to list files in a Windows folder with cmd?\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":6100,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[410],"tags":[417,418,420,414],"class_list":{"0":"post-4633","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-ms-dos","8":"tag-file","9":"tag-folder","10":"tag-list","11":"tag-script"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to list files in a Windows folder with cmd? MS-DOS<\/title>\n<meta name=\"description\" content=\"To list all files in a Windows folder using cmd, from the command prompt, use dir to display the list of files and their attributes.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to list files in a Windows folder with cmd?\" \/>\n<meta property=\"og:description\" content=\"To list all files in a Windows folder using cmd, from the command prompt, use dir to display the list of files and their attributes.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-03-26T05:15:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/watch-7937F87023D_1920x1080.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"How to list files in a Windows folder with cmd?\",\"datePublished\":\"2026-03-26T05:15:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/\"},\"wordCount\":845,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/watch-7937F87023D_1920x1080.jpeg\",\"keywords\":[\"File\",\"Folder\",\"List\",\"Script\"],\"articleSection\":[\"MS-DOS\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/\",\"url\":\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/\",\"name\":\"How to list files in a Windows folder with cmd? MS-DOS\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/watch-7937F87023D_1920x1080.jpeg\",\"datePublished\":\"2026-03-26T05:15:00+00:00\",\"description\":\"To list all files in a Windows folder using cmd, from the command prompt, use dir to display the list of files and their attributes.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/watch-7937F87023D_1920x1080.jpeg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/watch-7937F87023D_1920x1080.jpeg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to list files in a Windows folder with cmd?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/expert-only.com\/en\/#website\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"name\":\"SQL and IT Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/expert-only.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/expert-only.com\/en\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\",\"https:\/\/x.com\/expert_only\",\"https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to list files in a Windows folder with cmd? MS-DOS","description":"To list all files in a Windows folder using cmd, from the command prompt, use dir to display the list of files and their attributes.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/","og_locale":"en_US","og_type":"article","og_title":"How to list files in a Windows folder with cmd?","og_description":"To list all files in a Windows folder using cmd, from the command prompt, use dir to display the list of files and their attributes.","og_url":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2026-03-26T05:15:00+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/watch-7937F87023D_1920x1080.jpeg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"How to list files in a Windows folder with cmd?","datePublished":"2026-03-26T05:15:00+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/"},"wordCount":845,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/watch-7937F87023D_1920x1080.jpeg","keywords":["File","Folder","List","Script"],"articleSection":["MS-DOS"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/","url":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/","name":"How to list files in a Windows folder with cmd? MS-DOS","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/watch-7937F87023D_1920x1080.jpeg","datePublished":"2026-03-26T05:15:00+00:00","description":"To list all files in a Windows folder using cmd, from the command prompt, use dir to display the list of files and their attributes.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/watch-7937F87023D_1920x1080.jpeg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/01\/watch-7937F87023D_1920x1080.jpeg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/ms-dos\/list-files-in-folder-with-cmd\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"How to list files in a Windows folder with cmd?"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL and IT Tutorials","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","caption":"Expert-Only"}}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/4633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=4633"}],"version-history":[{"count":1,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/4633\/revisions"}],"predecessor-version":[{"id":26719,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/4633\/revisions\/26719"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/6100"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=4633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=4633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=4633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}