![]() |
If you work with large files on your Windows computer, then you need to know how to extract files and folders using the command prompt on Windows. You can manage your documents using the command prompt in just simple steps. In this article, we will show you how to use basic command prompt commands to compress or extract files and folders. This method also helps in improving the efficiency of file transfer and also saves disk space. Follow the instructions below to keep your files safe. Compress or Extract files and folders using CMDHere are some straightforward ways to compress and extract files and folders using the Command Prompt on Windows, complete with a step-by-step guide. How to Compress Files and Folders?Let’s understand with two different methods how to compress any file and folder using the command prompt. Method 1: Using Compact CommandStep 1: To compress files Click ‘Win + R’, type ‘cmd’ in the open box, and then press Enter. Step 2: Next, change the directory to the target location using the cd command: cd C:\Users\YourUsername\Documents
Step 3: After you have navigated to the directory where compression is needed, type the following command to compress a file: compact /c filename.ext
Replace ![]() To compress an entire folder and its subfolders: compact /c /s:directoryname
Replace Method 2: Creating a Compressed ZIP File Using Compress CommandStep 1: Open Command Prompt as Administrator. Step 2: Use the Makecab Command: First, list all files into a directive file: dir /b /s *.* > list.txt
Step 3: Then compress the files listed in makecab /f list.txt
How to Extract Files and Folders?Now, let’s check out with two different methods on how to extract any file and folder using the command prompt in no time. Method 1: Using Expand CommandStep 1: Search for Command Prompt by either clicking on the Start menu or pressing Win + R. Type cmd, and then hit the Enter key. Step 2: Use Expand Command: Navigate to the location of your compressed file (.cab), Use the cd C:\Path\To\Your\File
from there, you can make use of Expand Command. expand filename.cab -F:* C:\DestinationFolder
Replace filename.cab with the name of your compressed file and C:\DestinationFolder with the path where you want the files to be extracted. Method 2: Extracting ZIP Files using PowerShellStep 1: To launch PowerShell, type that in the Start menu. Step 2: Use the cd command to navigate to the location of the file: cd C:\Path\To\Your\File
Step 3: Extract the ZIP file: Expand-Archive -Path "C:\path\to\your\file.zip" -DestinationPath "C:\path\to\extract\to"
Replace These methods provide you with basic skills for compression and extraction using Command Prompt and PowerShell for files on Windows. ConclusionTo put it simply, using the Command Prompt in Windows for file/folder compression or deletion is straightforward and efficient. This strategy is particularly valuable for handling large data sets economically. If you learn just a handful of basic commands like ‘’compact” and ”expand’’, you can reduce volumes of disk space and enhance your file organization. Employing these commands consistently will enhance your expertise and enable you exploit all the capabilities your Windows system offers. How to Compress or Extract files and folders using CMD – FAQsHow do you compress and decompress files using the command line?
How to extract files using Command Prompt?
Which command is used to extract?
How to extract multiple zip files at once using cmd?
Which command is used to compress files?
|
Reffered: https://www.geeksforgeeks.org
TechTips |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 21 |