When using the Windows DIR command, you may have noticed that it displays a lot of information about the files and folders in a directory. This can sometimes make it difficult to quickly find the information you need, especially if you are looking for just the folder names. In this article, we will show you how to use the DIR command to display only the folder names along with their respective links.
What is the DIR command?
The DIR command is a built-in command in Windows that allows you to list the files and folders in a directory. It provides various options and parameters to customize the output. By default, when you run the DIR command, it displays detailed information about each file and folder, including the file size, date modified, and file attributes.
Show only folder name with the link information
If you want to see only the folder names along with their respective links, you can use the DIR command with the /AD parameter. The /AD parameter stands for "Attribute Directory" and it filters the output to display only directories (i.e., folders).
Here's how you can do it:
- Open the Command Prompt by pressing the Windows key + R, typing "cmd", and hitting Enter.
- Navigate to the directory for which you want to display the folder names.
- Once you are in the desired directory, type the following command and press Enter:
dir /AD
The command will list all the folders in the current directory along with their respective links. You will see only the folder names without any additional information about files or attributes.
If you want to save the folder names and their links to a text file for future reference, you can redirect the output of the DIR command to a file. Here's how:
- Type the following command and press Enter:
dir /AD > folder_names.txt
This command will save the folder names and their links to a file named "folder_names.txt" in the current directory. You can open this file using a text editor to view and manage the folder names later.
The DIR command in Windows is a powerful tool for listing files and folders in a directory. By using the /AD parameter, you can filter the output to display only the folder names along with their respective links. This can be useful when you want to quickly access a specific folder or create a list of folder names for reference. We hope this article has helped you understand how to show only folder names with the link information using the Windows DIR command.
References
| Reference | Description |
|---|---|
| Microsoft Docs - DIR command | Official documentation on the DIR command from Microsoft |
| Windows Command Line - Get List of Directories and Subdirectories from Command Line | A tutorial on getting a list of directories and subdirectories using the DIR command |