Mastering File Management: Setting Up Directories & Documents via Windows Command Line
Mastering File Management: Setting Up Directories & Documents via Windows Command Line
Quick Links
- Before You Begin: Copy the Folder Path and Launch Command Prompt
- Create a Single Folder
- Create a Folder Inside Another Folder (Subfolder)
- Create Multiple Folders at Once
- Create a File with Command Prompt
Key Takeaways
- To create a folder with Command Prompt, use the mkdir command followed by the folder name.
- Mkdir can also be used to create nested folders, multiple folders simultaneously, or a combination of both.
- If you want to create a file, enter type in Command Prompt, followed by nul > filename.ext, replacing “.ext” with the file type you want.
Whether you’re looking to create a script, make several folders at once, or you simply prefer command-line methods over graphical ones, it’s quick and easy to make folders or files using Command Prompt. We’ll show you how to do it on your Windows 11 or Windows 10 PC.
Before You Begin: Copy the Folder Path and Launch Command Prompt
To use the following methods, you must first copy the path of the folder where you’ll create new folders or files, and then run the Command Prompt utility.
To copy a folder’s full path, launch File Explorer using Windows+E and find your folder. Hold down the Shift key on your keyboard, right-click your folder, and choose “Copy as Path.”
To open Command Prompt , click the Start button, search for command prompt, then click the relevant result or press Enter. While making folders, if you encounter an error, run Command Prompt as an admin by right-clicking the utility and choosing “Run as Administrator.” Make sure to select “Yes” in the User Account Control prompt.
After opening Command Prompt, type cd, press Spacebar, paste the folder path you copied by pressing Ctrl+V, and press Enter. This makes your chosen folder the current working directory in the tool. Each command you run will perform the specified action in this directory.
Create a Single Folder
To make a single folder, type the following command, replacing “FolderName” with the name you want to assign to your folder. Then, press Enter.
mkdir FolderName
For example, to make a folder named “Mahesh”, use the following command:
mkdir Mahesh
To create a folder that has spaces in its name, enclose the name with double quotes like this:
mkdir “Mahesh Makvana”
Create a Folder Inside Another Folder (Subfolder)
One way to make a folder inside another folder is to make that other folder the current working directory. To do that, type cd, press Spacebar, enter the name of the folder in which you want to create a new folder, and press Enter. Then, type the following command, replace “MyFolder” with the name you want to give to your new folder, and press Enter.
mkdir MyFolder
Another way to create a folder inside a folder is to specify the other folder right in the mkdir command itself. For example, if you have a subfolder named “Photos” and you want to create a new folder named “Personal” inside it, use the following command:
mkdir Photos\Personal
Create Multiple Folders at Once
To make several folders at once , add the required folder names to the mkdir command.
For example, to create three separate folders named Documents, Photos, and Videos, use the following command:
mkdir Documents Photos Videos
Make sure to enclose the folder name with double quotes if its name has spaces.
Create a File with Command Prompt
Command Prompt allows you to create empty files, which you can then use with appropriate apps. The syntax for creating a new file is as follows:
type nul > name.ext
Here, “name” is the name of the file you want to create and “ext” is the extension of the file .
For example, to make a text file named document.txt, you’ll use the following command:
type nul > document.txt
To create a text file and add some actual text to it, use the following command. Replace “Welcome to How-To Geek” with the text you want to add and “howtogeek” with the name you want to use for the file.
echo Welcome to How-To Geek > howtogeek.txt
When you open howtogeek.txt in a text editor you’ll find it has “Welcome to How-To Geek” written in it.
And that’s how you make folders and files without using graphical tools on your Windows machine.
Also read:
- [New] Cutting-Edge Graphic Amendments for 2024
- [Product_Name]: The Ultimate Autonomous Analytics Solution for Superior SEO Results
- [Updated] Exploring Instagram's Max Video Length for 2024
- [Updated] Streamlining Your Photo Editing The Crop Essentials
- 4 solution to get rid of pokemon fail to detect location On Vivo T2 5G | Dr.fone
- Delete Kernel or Full Memory Dumps From Windows 11 Systematically
- Digital Influencers at Play: Navigating Through Facebook, Twitter, Instagram & YouTube
- Elite's Take: The Future of Global AI Technology
- Expert Tips for Resolving 'Task Unsuccessful' Errors in Microsoft's Latest Operating System
- In 2024, A Step-by-Step Guide to Finding Your Apple ID From Your iPhone 15 Pro Max
- iSpoofer is not working On ZTE Axon 40 Lite? Fixed | Dr.fone
- Leveraging Social Giants: Tactics for Facebook, Twitter, Instagram & YouTube Success
- Maximize Connections: Streamlined Menu for LinkedIn, Facebook, and YouTube | Instant Page Navigation to Top
- Maximize Your Site's Accessibility - Swiftly Navigate to the Top and Seamlessly Connect with Facebook, LinkedIn, and YouTube Through Our Expanding Toggle Menu
- The Top Four Digital Connectors: Facebook, Twitter, Instagram and You-Tube
- Top Tips for Optimizing Menu Functionality on Leading Networks – Learn to Efficiently Scroll & Manage Content on Facebook, LinkedIn, and YouTube
- Unveiling IGTV Insights Key Measures for Effective Content
- Title: Mastering File Management: Setting Up Directories & Documents via Windows Command Line
- Author: Michael
- Created at : 2024-09-29 16:08:53
- Updated at : 2024-10-01 16:56:34
- Link: https://win-forum.techidaily.com/mastering-file-management-setting-up-directories-and-documents-via-windows-command-line/
- License: This work is licensed under CC BY-NC-SA 4.0.