Search
  • For Individuals
      « Back
    • Windows Data Recovery

      Recovers lost or deleted Office documents, emails, presentations & multimedia files.

      Free Standard Professional Premium

    • Mac Data Recovery

      Recovers deleted files, photos, videos etc. on Mac.

      Free Standard Professional Premium

    • Photo Recovery

      Recover photos, videos, & audio files from all cameras and storage on Windows.

      Free Standard Professional Premium

    • Video Repair
    • Photo Repair
    • iPhone Data Recovery
  • For Business
      « Back
    • Email Repair & Converter

      Repair for Exchange Converter for EDB Converter for OST Converter for NSF Converter for OST MBOX Repair for Outlook

    • Database & File Repair

      Repair for MS SQL Repair for Access Repair for QuickBooks Software Repair for Excel Extractor for Windows Backup Repair for MySQL

    • Data Recovery & Erasure

      Data Recovery Professional Data Recovery Technician Mac Recovery for Technician Virtual Machine Recovery File Erasure Software Mobile Erasure Drive Erasure File Eraser Software File Eraser Software for Mac

    • Toolkit

      Exchange Toolkit Outlook Toolkit File Repair Toolkit MS SQL Toolkit Data Recovery Toolkit

    • Forensic

      Email Forensic Exchange Auditor Log Analyzer for MySQL Log Analyzer for MS SQL

  • Store
  • Partners
  • Services
  • Offers
  • Support

 

  • For Individuals
    DIY software for anyone who works with data.

    Windows Data Recovery Recovers lost or deleted Office documents, emails, presentations & multimedia files

    Free Standard Professional Premium

    Mac Data Recovery Especially for Mac users to recover deleted documents and multimedia files from macOS

    Free Standard Professional Premium

    Video Repair Windows Mac Repair multiple corrupt videos in one go. Supports MP4, MOV & other formats.

    StandardPremium

    Photo Recovery Windows Mac Recover photos, videos, & audio files from all cameras and storage on Windows.

    Standard Professional Premium

    iPhone Data Recovery Windows Mac Recover deleted photos, videos, contacts, messages etc. directly from iPhone & iPad

    Recover Erase Toolkit

    Photo Repair Windows Mac Repair multiple corrupt photos in one go. Supports JPEG & other formats.

    Standard Professional Premium


  • For Business
    • Email Repair
    • Email Converter
    • File Repair
    • Data Recovery & Erasure
    • Toolkit
    • Forensic

    Exchange Repair Repair corrupt EDB file & export mailboxes to Live Exchange or Office 365

    Outlook PST Repair Repair corrupt PST & recover all mailbox items including deleted emails & contacts

    OLM Repair Repair Outlook for Mac (OLM) 2011 & 2016 backup files & recover all mailbox items

    Exchange Toolkit Repair EDB & Exchange backup file to restore mailboxes, convert OST to PST, & convert EDB to PST

    Active Directory Repair Repair corrupt Active Directory database (Ntds.dit file) & extract all objects in original form

    EDB to PST Convert online & offline EDB file & extract all mailbox items including Public Folders in PST

    OST to PST Convert inaccessible OST file & extract all mailbox items including deleted emails in PST

    NSF to PST Convert IBM Notes NSF file & export all mailbox items including emails & attachments to PST

    MBOX to PST Convert MBOX file of Thunderbird, Entourage & other clients, & export mailbox data to PST

    OLM to PST Convert Outlook for Mac Data File (OLM) & export all mailbox data to PST in original form

    GroupWise to PST Convert GroupWise mail & export all mailbox items - emails, attachments, etc. - to PST

    EML to PST Convert Windows Live Mail (EML) file & export mailbox data - emails, attachments, etc. - to PST

    Office 365 to PST Connect to Office 365 account & export mailbox data to PST and various other formats

    DBX to PST Convert Outlook Express (DBX) file & export all mailbox data - emails, attachments, etc. - to PST

    SQL Repair Repair corrupt .mdf & .ndf files and recover all database components in original form

    Access Repair Repair corrupt .ACCDB and .MDB files & recover all records & objects in a new database

    QuickBooks Repair Repair corrupt QuickBooks® data file & recover all file components in original form

    MySQL Repair Repair MyISAM & InnoDB tables and recover all objects - keys, views, tables, triggers, etc.

    Excel Repair Repair corrupt Excel (.XLS & .XLSX) files and recover tables, charts, chart sheet, etc.

    BKF Repair Repair corrupt backup (BKF, ZIP, VHDX and .FD) files and restore complete data

    Database Converter Interconvert MS SQL, MySQL, SQLite, and SQL Anywhere database files

    PowerPoint Repair Repair corrupt PPT files and restore tables, header, footer, & charts, etc. like new

    File Repair Toolkit Repair corrupt Excel, PowerPoint, Word & PDF files & restore data to original form

    Data Recovery Windows Mac Recover lost or deleted data from HDD, SSD, external USB drive, RAID & more.

    Technician Toolkit

    Tape Data Recovery Retrives data from all types and capacities of tape drives including LTO 1, LTO 2, LTO 3, & others.

    Virtual Machine Recovery Recover documents, multimedia files, and database files from any virtual machine

    File Erasure Permanently wipe files and folders, and erase traces of apps and Internet activity.

    Standard Corporate

    Mobile Erasure Certified and permanent data erasure software for iPhones, iPads, & Android devices

    Drive Erasure Certified and permanent data erasure software for HDD, SSD, & other storage media Windows Mac

    Exchange Toolkit 5-in-1 software toolkit to recover Exchange database, convert EDB to PST, convert OST to PST, restore Exchange backup, and reset Windows Server password.

    Outlook Toolkit Comprehensive software suite to repair PST files, merge PST files, eliminate duplicate emails, compact PST files, and recover lost or forgotten Outlook passwords.

    File Repair Toolkit Powerful file repair utility to fix corrupt Word, PowerPoint, and Excel documents created in Microsoft Office. It also repairs corrupt PDF files and recovers all objects.

    MS SQL Toolkit 5-in-1 software toolkit to repair corrupt SQL database, restore database from corrupt backup, reset database password, analyze SQL logs, & interconvert databases.

    Data Recovery Toolkit Software helps to recovers deleted data from Windows, Mac and Linux storage devices. Also supports recovery from RAIDs & Virtual Drives.

    Email Forensic Advanced email forensic solution for cyber experts to audit, analyze, or investigate emails & gather evidences.

    Exchange Auditor Exchange Server monitoring solution to automate audits, scans and generate reports ìn real-time.

    Log Analyzer for MySQL Analyze forensic details of MySQL server database log files such as Redo, General Query, and Binary Log.

    Log Analyzer for MS SQL Track & analyze MS SQL Server database transactions log files.

    STELLAR EMAIL FORENSIC

    Advanced email forensic tool to analyze and collect the mailbox data of email clients

    Learn More arrow


    All Products

    All Products

    All Products

    All Products

  • Our Partners
  • Lab Services
  • Trending Searches

    Data Recovery

    Photo Recovery

    Video Repair

    iPhone Data Recovery

    File Erasure Software

    Exchange Repair

    OST to PST

    PST Repair

    Raid Recovery

    MS SQL Repair

  • English Deutsch Français Nederlands Italiano Español 日本語 简体中文
  • Support
Windows Data Recovery - Standard 3 minute read

How to Recover Deleted Files Using Command Prompt?

Updated on July 7th, 2021
Isha Rikhi
Written By
Isha Rikhi
Rohit Arora
Approved By
Rohit Arora

Summary: Now day's there are many methods available to recover deleted data. And the most affordable way to recover data is via using command prompt however, it is little technical. This guide has detailed steps you need to follow for recovering data using command prompt.

How to Recover Deleted Files Using Command Prompt?

Command Prompt can troubleshoot certain issues related to Windows including external hard drive recovery, memory cards and flash drives recovery. Being one of the most powerful inbuilt utility tool, it helps users to retrieve the files  lost due to accidental deletion, virus attack. Along with it, Command prompt repairs bad sectors on storage devices and convert Raw File System to NTFS for free. So if you have accidentally deleted or lost files, you can simply use Command prompt to recover it.

Contents

  • File Structure:
  • Afterpiece

File Structure:

Before going further let’s understand the file structure first

A file consists of two parts:

✓ A directory which consists the file name and the list of the blocks
✓ The actual blocks which contain the data

When a file is deleted, only the directory is removed whereas the actual block if not overwritten or modified, still contains the files. Thereby, the directory entries are marked ‘available’ and are hidden from the Operating System. In such cases, you can easily recover your lost files using the command prompt.

Recover your files using Command Prompt:

One of the most effective methods to recover deleted files from the external drive is through Command Prompt. Command Prompt executes commands to perform the assigned task. That said, there are some commands, which can recover your deleted files. They are as follows:

1. Recover files from your external drive

If you have accidentally deleted files from the storage drive such as hard drives, USB, flash sticks etc. Follow these commands in command prompt:

i. Press Windows key + R and in the search box, type CMD
ii. In the Command Prompt window, type chkdsk ‘drive letter’ /f and hit Enter.
For example: C : \ USERS\ PROGRAM FILES\ chkdsk D : /f
iii. Press Y until the command lines start again
iv. Type the drive letter again and hit Enter (The command line will go back to the start)
v. Now, type [drive letter : \ >attrib –h –r –s /s /d *.*]. This command will recover all the files in the storage drive (attrib -r -s drive:\<path>\<foldername>)
Where,
–r is Read-only attribute: Files are readable and cannot be changed
–s assigns ‘System’ attribute to the selected files
–h command assigns the ‘Hidden’ attribute to the selected files
‘/S’ implies to search the specified path including subfolders
‘/D’ command includes process folders

cmd window

vi. Once the process is complete, a new folder is created on your external drive with all the recovered files. Probably, the files will be in .CHK format. Change the file format and save the files at the preferred location

2. Restore files from Recycle Bin using Command Prompt:

When the Recycle Bin becomes full, Windows deletes files to make space for the newly deleted ones. However, these removed files are still recoverable until the Recycle Bin is emptied.

Follow these commands to restore files from Recycle Bin:

i. In the command prompt window, type: start shell:RecycleBinFolder and press Enter
For example: C:\> start shell:RecycleBinFolder
ii. Select the files and restore them

Recover files when command prompt does not help you

Even though you can recover deleted files through Command Prompt but the prerequisite is that you must be familiar with technical jargons. The reason being, you have to type in many commands and if you’re not familiar with the command lines, then it may seem complicated.

Furthermore, Command Prompt cannot recover files from a formatted storage drive, for that you need to leverage an external drive recovery software. Stellar Data Recovery- Standard for Windows software can assist you in recovering your deleted files from the external drive hassle-free. It doesn’t require any familiarity with the command lines and is quite easy to use.

Watch this video to see how easily Stellar Data Recovery- Standard for Windows recovers lost or deleted data

Afterpiece

You can perform advanced administrative functions via Command Prompt. But you need to get familiar with each parameter and how they can be combined to achieve the desired result. Sometimes, the process gets complicated. On similar lines, recovering deleted files should be a simple and hassle-free process and that is when Stellar Data Recovery- Standard for Windows rises to the occasion.

About The Author

isha

Isha is a technical blogger and data recovery expert. She has experience in Windows data recovery. She writes about technical tips and tutorials.

Best Selling Products

Stellar Data Recovery Professional

Stellar Data Recovery Professional softw

Read More

Stellar Data Recovery Premium

Stellar Data Recovery Premium for Window

Read More

Stellar Data Recovery Technician

Stellar Data Recovery Technician intelli

Read More

Stellar Data Recovery Toolkit

Stellar Data Recovery Toolkit is an adva

Read More

31 comments

  1. Micah says:
    March 10, 2022 at 9:53 am

    Hi, Thanks for sharing such a wonderful article; this article is really useful for someone who doesn’t know much about recovering files using command prompts. Thanks a lot

    Reply
  2. Jenny Walsh says:
    August 11, 2020 at 2:35 am

    Need HELP!!! I delete a large amount of avi files stored in a 2TB external drive by accident. I have not touched that 2TB drive since deleted them. I wanted to use the Command prompt described in this article to bring those files back but wanted to write those recovered files to another external drive as I don’t want to overwrite in that 2TB drive just in case if anything goes wrong and I can redo it again or use a recovery software to do it. Do you have that command or I must recover those files back to the same drive? Many thanks for your help!!!

    Reply
    1. Ravi Singh says:
      August 28, 2020 at 11:49 am

      The command is for an inaccessible or corrupt drive where the file system gets damaged. In your case, since you have accidentally deleted data, you must use Stellar Data Recovery software to get back your AVI files. To make things faster, choose videos from the options in software while scanning the storage media. It will help you recover AVI files faster.

      Reply
  3. Zeeshan Iqbal says:
    February 24, 2019 at 6:23 am

    Hi Isha, I am suffering from the same problem. I tell you the whole incident,
    3 days ago i saw an option in Computer=>Properties that “compress files to save space”, as I had not enough space on my hard disk, so i checked this bOx. A process started to compress the files of both local disks (C and D).
    Next time i started my pc it said
    “bootMGR is comressed Press LSHIFT+CTRL+Delete to Restart”.
    I got horrified with this note. I knew that all this happened due to that compression process. I inserted window disk in pc and from repair i opened command prompt=>diskpart and after selecting hard disk i entered .’clean’ command. I thougt that this command will restore that compession task.
    But all my hard disk was cleaned and ‘unallocated space’ name appeared..so i lost all my data from hard disk. Then i just installed window on my pc and that “unallocated space” changed to “Local Disk C” …That data meant everything to me, I collected that data from last four years. I have tried to recover my data from some softwares but all are demanding money ($) for activation to use that software… Kindly tell me how to get that data back fully. From command panel or any recovery software that does not demands money. As I dont have any money, I am a Student… Please help me recover all my data (all happened due to diskpart clean command)…kindly email me the way.. As i cant come to this website again and again.please help me

    Reply
    1. Satyeshu Kumar says:
      February 25, 2019 at 11:10 am

      Hello Zeeshan,

      You can use the free version of Stellar Data Recovery for Windows that allows the user to save up to 1 GB data free of cost (download link shared below)

      However, if you have more files then, in this case, need to purchase the full commercial software to recover files.

      Free Data Recovery Download Link: https://cloud.stellarinfo.com/StellarDataRecoveryFree-B.exe

      Reply
  4. Hazel Carter says:
    January 17, 2019 at 11:17 am

    Frankly speaking it is very hard to recover deleted files for average human being. I almost lost my senses when the horrible black screen arrives in front of my eyes. A very good alternative to this is user-friendly interface of Stellar Data Recovery Professional software.

    Reply
    1. Satyeshu Kumar says:
      January 18, 2019 at 5:09 am

      Hello Hazel,

      Thanks for feedback.

      Reply
  5. ric says:
    December 28, 2018 at 9:32 pm

    I’m trying to recover video files from my SD card. I’ve followed the steps and just to be sure specified the DCIM folder. When I hit enter on:

    F:\DCIM\112D7000> attrib -h -r -s /s /d *.*

    I get: File not found – *.*

    What am I doing wrong? What’s the *.* part of the command?

    Reply
    1. Isha Rikhi says:
      January 3, 2019 at 2:56 am

      Hello Ric,

      We would recommend you to select SD Card directly in our software and select file types which you want to recover. Then, start the scanning process in order to check the possibility of data recovery.

      Also, let us know the reason of data loss so that we can assist you further.

      Reply

Comments navigation

Older comments Page 1 Page 2

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

  +  83  =  90

Table of Contents    

  1. File Structure:
  2. Afterpiece

Categories

Related Posts

Solutions to recover deleted Google Drive files
Windows Data Recovery - Standard

How to Recover Deleted Google Drive Files?

Stellar Author Ashutosh Kumar March 2, 2022 Read More
recover-deleted-files-in-outlook
Windows Data Recovery - Standard

How to Recover Deleted Outlook Emails on Windows 10/11?

Stellar Author Mansi Verma January 28, 2022 Read More
Windows Data Recovery - Standard

How to Find Hidden Recycle Bin on Windows 10?

Stellar Author Ashutosh Kumar January 19, 2022 Read More

Stellar Official Website

Stellar Data Recovery Inc.
48 Bridge Street Metuchen,
New Jersey 08840,
United States

ALSO AVAILABLE AT

About

  • About us
  • Career
  • ISMS Policy
  • Privacy Policy
  • Terms of Use
  • License Policy
  • Refund Policy
  • End User License Agreement

RESOURCES

  • Blog
  • Articles
  • Product Videos
  • Knowledge Base
  • Case Studies
  • Whitepapers
  • Software Catalog

NEWS & EVENTS

  • News
  • Events

PARTNERS

  • Affiliates
  • Resellers
  • Distributors

Useful Links

  • Contact Us
  • Support
  • Special Offers
  • Student Discounts
  • Awards & Reviews
  • Downloads
  • Store
  • Sitemap
Follow Us

Stellar & Stellar Data Recovery are Registered Trademarks of Stellar Information Technology Pvt. Ltd. © Copyright 2022 Stellar Information Technology Pvt. Ltd. All Trademarks Acknowledged.

DMCA.com Protection Status
We use cookies on this website. By using this site, you agree that we may store and access cookies on your device Read More Got it!