The Windows DIR command is a powerful tool that allows users to view the contents of a directory, including files and folders. However, sometimes you may only want to see the folder names along with their link information. In this article, we will guide you on how to use the DIR command to show only folder names with link information.
Step 1: Open Command Prompt
To get started, you need to open the Command Prompt on your Windows computer. You can do this by pressing the Windows key + R to open the Run dialog box, then type "cmd" and press Enter. Alternatively, you can search for "Command Prompt" in the Start menu and click on it.
Step 2: Navigate to the Desired Directory
Once the Command Prompt is open, you need to navigate to the directory for which you want to display the folder names with link information. You can use the "cd" command followed by the directory path to navigate to a specific directory. For example, if you want to navigate to the "Documents" folder, you can type:
cd C:\Users\YourUsername\Documents
Replace "YourUsername" with your actual username.
Step 3: Use the DIR Command
Now that you are in the desired directory, you can use the DIR command to display only the folder names with link information. Simply type the following command and press Enter:
dir /ad /b /s > folders.txt
Let's break down this command:
dir: This is the command itself./ad: This option tells the DIR command to only display directories (folders)./b: This option removes any additional information and only displays the folder names./s: This option makes the command search in all subdirectories as well.> folders.txt: This part of the command redirects the output to a text file named "folders.txt" in the current directory. You can change the file name if desired.
After running the command, you will not see any output in the Command Prompt window. Instead, the folder names with link information will be saved in the "folders.txt" file.
Step 4: View the Folder Names with Link Information
To view the folder names with link information, you can open the "folders.txt" file using any text editor, such as Notepad. Simply navigate to the directory where you saved the file, double-click on it, and it will open in the default text editor.
In the "folders.txt" file, you will see a list of all the folder names in the directory and its subdirectories, along with their link information. Each folder name will be listed on a separate line.
The Windows DIR command is a handy tool for managing and organizing your files and folders. By using the steps outlined in this article, you can easily display only the folder names with link information. This can be useful when you need a quick overview of the directories in a specific location.
| Reference | Link |
|---|---|
| Microsoft Docs - DIR Command | https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/dir |
| Computer Hope - DIR Command | https://www.computerhope.com/dirhlp.htm |