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. Aqib says:
    October 9, 2018 at 3:47 pm

    Hello Isha, I put a bit-locker encryption to my external hard drive using windows 10. But when it was locked, i tried many times to unlock it by using the password and bit-locker recovery key but it didn’t open. It display “incorrect password” when I enter password. I’m 100% sure that the password and the bit-locker recovery key is correct. I’ve also updated windows 10 but my problem didn’t solve. Please help me to recover my data or to unlock my external hard drive. I’ll be very very very thankful to you.

    Reply
    1. Isha Rikhi says:
      October 10, 2018 at 3:22 am

      Hello Aqib,

      Unfortunately, we didn’t help you much unless the hard drive is unlocked. The data recovery software can’t able to work on the locked hard drive.
      We suggest to hit & try password again, in case of any success Stellar Data Recovery Software for Windows can be helpful.

      Reply
  2. Nirav says:
    July 26, 2018 at 3:08 am

    Hi Isha,

    Thanks for the above information.

    I accidentally deleted all the files from my external hard drive.

    I followed the procedure from the Command prompt, but getting the below error.
    C:\Users\NV>attrib -H -R -S /S /D G:\*.*
    Access denied – G:\$RECYCLE.BIN\S-1-5-21-1072449878-812698141-267826086-1000
    Access denied – G:\$RECYCLE.BIN\S-1-5-21-3216060475-3821369746-1632863026-1002
    Access denied – G:\$RECYCLE.BIN\S-1-5-21-3763746185-820522019-1832817767-1001
    Access denied – G:\found.000
    Access denied – G:\System Volume Information

    Can you help me with below?

    Reply
    1. Isha Rikhi says:
      July 27, 2018 at 7:04 am

      Hello Nirav,

      As per your query we recommend you to use our demo version of Stellar Windows Data Recovery- Pro software. You can download it from the below link:

      https://cloud.stellarinfo.com/StellarDataRecoveryProfessional-B.exe

      We would like to inform you that free download is used to scan the drive and after the scan, it will show you all the lost files which can be recoverable by using the purchased version. In case you are unable to see the files listed inside the application then we recommend you to contact support team on their below email address:

      support@stellarinfo.com

      Reply
  3. Alana Hex says:
    July 8, 2018 at 7:46 pm

    Sounds great. Keep up the great spirit.

    Reply
    1. Isha Rikhi says:
      July 9, 2018 at 5:00 am

      Thanks Alana

      Reply
  4. Eric says:
    May 18, 2018 at 2:42 am

    If you correctly use command prompt, it is one of the strongest in-built utility tool. With the correct knowledge of commands the dependency on third party tools reduce to minimum.

    Reply
    1. Isha Rikhi says:
      May 18, 2018 at 3:10 am

      Hello Eric,

      Appreciate the feedback.

      Reply
  5. Tim says:
    May 18, 2018 at 2:40 am

    If you correctly use command prompt, it is one of the strongest in-built utility tool. With the correct knowledge of commands the dependency on third party tools reduce to minimum.

    Reply
    1. Isha Rikhi says:
      May 18, 2018 at 3:11 am

      Hello Tim,

      Its a great inbuilt tool. Thanks for the comment.

      Reply
  6. Baron says:
    May 17, 2018 at 3:12 am

    Your site is so fantastic. I learn many important things from this post.

    Reply
    1. Isha Rikhi says:
      May 17, 2018 at 3:52 am

      Hello Baron,

      Thanks for reading the post.

      Reply
      1. bryan says:
        May 27, 2018 at 12:28 pm

        Hi i mistakenly formatted my hard drive disk with cmd and lost everything can you help me recover my lost files..with cmd

      2. Isha Rikhi says:
        May 28, 2018 at 3:20 am

        Hello Bryan,

        One of the most effective methods to recover deleted files from the external drive is through 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:\\)
        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
        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

        If the above methods didn’t able to recover, we recommend to try Stellar Windows Data Recovery Software.

  7. ryda says:
    May 16, 2018 at 8:58 pm

    Hi Isha 🙂
    I need your help. Please answer my questions. Thanks in advance.

    Question 1
    Lately, I can’t get to my log in page. It was on a cooling system problem. I have no choice since whenever I tried to reboot it, it just failed. So, I figured, it might be the fan prob. Then, I sent it so that the fan prob can be fixed. Did I made the right choice here?

    Question 2
    I dont know my diagnosis of the failure of getting to my log in page. But, I have to reformat my laptop. Windows 10 is installed. Backup of files was not done. I dont want to know why this is the solution to my problem.

    Can you please help me. I want my old files back. I dont know how to locate it. I think I need them back. Also, I dislike this new windows. I want to reinstall my previous windows 7 back. But most importantly, how to get back my files? Is it possible to not lost any files without having them back up. Which option is safer?

    I want to find my files by myself but I dont know how to look for it. Can you help me? I am looking forward to your reply. Thank you for your kind attention.

    Reply
    1. Isha Rikhi says:
      May 18, 2018 at 3:41 am

      Hello Ryda,

      Thanks for contacting Stellar Data Recovery

      Answer 1: As you have a fan problem with the system so it need to be resolved by the manufacturer.

      Answer 2: We have Stellar Windows Data Recovery Professional software to recover the lost data. However software cannot reload your previously installed Windows operating system.

      We recommend you to download the demo version of the software from the below mentioned link:
      https://cloud.stellarinfo.com/StellarDataRecoveryProfessional-B.exe

      After installing the software, kindly run it and perform the scan using ‘Can’t Find Drive’ option to search for the volumes. Once the volume is listed then please run the scan to check the possibility of recovery.

      Reply
  8. Codey Tucker says:
    April 25, 2018 at 11:10 am

    Thanks Isha for this tip

    I never imagine to recover deleted files in such simple manner.

    Reply
    1. Isha Rikhi says:
      April 26, 2018 at 6:47 am

      Hello Codey,

      Thank You for the nice words.

      Reply
  9. Jamey Stilling says:
    March 14, 2018 at 10:31 am

    I appreciate your blog! for aware to recover deleted files . I go with the second one used this software for recovering a deleted file. Thanks!

    Reply
    1. Isha Rikhi says:
      March 16, 2018 at 12:39 pm

      Hello Jamey,

      Thanks for contacting Stellar

      Thanks for using our software. Please dont forget to follow us on twitter, facebook and youtube.

      Reply
  10. Genie Reddick says:
    December 19, 2017 at 11:02 am

    I follow these commands to recover our lost data from Hard drives. Thanks for giving such wonderful information!

    Reply
    1. Isha Rikhi says:
      December 21, 2017 at 3:46 am

      Hello Genie,

      We are glad that you tried our given method.
      You may also subscribe to our newsletter for more offer and updates.

      Reply

Comments navigation

Page 1 Page 2 Newer comments

Leave a comment Cancel reply

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

23  −    =  19

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!