Windows 10: How do you reset a USB flash drive back to factory settings? Solved

Page 3 of 4 FirstFirst 1234 LastLast
  1.    23 Jan 2018 #21

    lx07 said: View Post
    You are quite right of course. If you wanted it exactly the same you'd have to restore it but who would back up an empty USB drive?

    In fact the second partition type (0xC) in your example is correct for USB stick. The first one (0xB) is for CHS (old style HDD). MS got it right and Lexar got it wrong if you want to be pedantic about it (and if you trust Wikipedia). Mind you I manually assign partition types a lot (I have to use hybrid GPT/MBR partition scheme) and always give the 0x7 irrespective if they are FAT or NTFS and that works too so it probably doesn't matter.

    Delete its record from the registry.

    First assign it some letter like Z so you know what it is. Doesn't matter how - through Disk Management or diskpart assign letter=z - the result is the same.

    Then unplug it. Then go to regedit and delete HKLM\SYSTEM\MountedDevices value \DosDevices\Z:

    Next time you plug it in it will assign E or whatever is the first unallocated letter.

    It is nothing to do with the USB - only your Windows install.

    Attachment 173920
    To be honest I don't want to mess around with the registry. I think I must be be misinterpreting what the Assign command does? So is it better to not type the Assign command into Diskpart at all. I'm just trying to make sure the flash drive gets assigned a drive letter in exactly the same way as it would do if it was a brand new flash drive being plugged into my laptop. Like I said at the beginning when I first posted I just want the flash drive to be set up and behaving in exactly the same way as when I first purchased it. I thought that if you typed in the assign command (without a letter) it ensured that the flash drives letter would be assigned dynamically from then on i.e if the drive letter previously had a fixed drive letter the Assign command would remove that fixed letter and set it to dynamic. I'm worried that if the drive letter gets fixed by the Assign command that there may be conflicts when other flash drives are plugged in. That's why I don't want to have a fixed drive letter on any of my flash drives..thats why I keep mentioning that I would like dynamic drive letter assignment. Am I getting crossed wires and misunderstanding the way flash drive letter assignment works in Windows?
      My ComputerSystem Spec

  2.    23 Jan 2018 #22

    sportsfan148 said: View Post
    To be honest I don't want to mess around with the registry. So is it better to not type the Assign command into Diskpart. I'm just trying to make sure the flash drive gets assigned a drive letter in exactly the same way as it would do if it was a brand new flash drive. Like I said at the beginning when I first posted I just want the drive set up and behaving in exactly the same way as when I first purchased it. I thought that if you typed in the assign command (without a letter) it ensured that the flash drives letter would be assigned dynamically from then on i.e if the drive letter previously had a fixed drive letter the Assign command would remove that fixed letter and set it to dynamic
    No - assign assigns a letter and stores it in the registry key above (not on the USB). It does the same as doing it in Disk Management except you can assign mount points (letters) to otherwise unavailable partitions.

    You could try remove instead of assign. You may find remove just stores it without a mount point and assigns no letter when you plug it in the next time though (which would mean until you assigned a letter you would not see it in File Explorer).

    If you don't want to delete the registry key then you'd have to change the serial number (which it matches to the binary value in the registry). I've no idea how to do that - whether it is randomly generated when you format or fixed for the device I just don't know and don't have a blank USB to test it.
      My ComputerSystem Spec

  3.    23 Jan 2018 #23

    lx07 said: View Post
    You could try remove instead of assign as assign will just assign another letter. You may find remove just stores it without a mount point and assigns no letter when you plug it in though so until you assigned a letter you would not see it in File Explorer.

    Other than that you'd have to change the serial number (which it matches to the binary value in the registry). I've no idea how to do that - whether it is randomly generated when you format or fixed for the device I just don't know.
    Remove doesn't sound right then. What happens if two flash drives are plugged in at the same time then that the Diskpart Assign command had given the same letter to?
      My ComputerSystem Spec

  4.    23 Jan 2018 #24

    sportsfan148 said: View Post
    Remove doesn't sound right then. What happens if two flash drives are plugged in at the same time then that the Diskpart Assign command had given the same letter to?
    If you assigned separately 2 USB sticks the letter S you mean?

    Normally you will not see the second one you plug in in File Explorer and you'll have to manually assign a different letter to it.

    Again though this is a function of your Windows install not the USB stick(s). If you tried another PC or reinstalled Windows neither would be assigned S.
      My ComputerSystem Spec

  5.    23 Jan 2018 #25

    lx07 said: View Post
    If you assigned separately 2 USB sticks the letter S you mean?

    Normally you will not see the second one you plug in in File Explorer and you'll have to manually assign a different letter to it.

    Again though this is a function of your Windows install not the USB stick(s). If you tried another PC or reinstalled Windows neither would be assigned S.
    Yeah..its as I thought then. I'm just trying to avoid conflicts. If I'm understanding you correctly..Is a flash drive assigned a drive letter the first time its inserted into a PC and that letter will stick with that flash drive permanently? In my case then if I'm inserting each of my several flash drives separately (my next available drive letter is always E: after my c: system drive and D: DVDRW drive). Does each of them when inserted individually get drive E: or is the first one assigned E: (stored in the registry)and even after you've removed it ...each one when plugged in separately after that has an individual letter further down the alphabet? Is it the Assign command that causes this? I'm sure ive inserted USB flash drives before that had a drive letter E: one day and was then recognised as F: on another occasion
      My ComputerSystem Spec

  6.    23 Jan 2018 #26

    Hey sportsfan148,
    Just an FYI ... DriveCleanup is a command line utility for seeing/cleaning up non present drives from the device tree/registry. Be sure to read the DriveCleanup.txt for info/command line switches

    DriveCleanup v1.5 - Drive Tools for Windows
      My ComputersSystem Spec


  7. Posts : 657
    Windows 7 Ultimate 32bit
       25 Jan 2018 #27

    Why commandline utility? Make life simple. Put Drive Cleanup into a folder and use it periodically to remove all non-present devices.

    Download v 0.8.1 of the drivecleanup.zip from Drive Tools for Windows. ( You can use the latest version v 1.5.0. I started using it from v 0.8.1 and still sticking to it)

    Unzip it to a folder, say drivecleanup.

    You will have two folders Win32 and x64 each containing DriveCleanup.exe for 32 bit and 64 bit respectively.

    Remove all USB storage devices from your system (except your USB Keyboard and mouse - if you have) and reboot.

    Right click on the DriveCleanup.exe and run as administrator. (Use theDriveCleanup.exe file appropriate for your bit version of Windows.).

    After the clean up act, reboot.

    ( When you plug in your USB devices after this cleanup these will be installed afresh. What you have done is to remove all non-present devices and drive letters associated with them and start with a clean slate. )

    Ed Tittel says http://itknowledgeexchange.techtarge...rage-metadata/
    Last edited by jumanji; 25 Jan 2018 at 15:13.
      My ComputerSystem Spec

  8.    07 May 2018 #28

    lx07 said: View Post
    Sure they can.

    "Clean" destroys the partition table. There is also "Clean all" which zeros the disk. If you are formatting after without "quick" option it doesn't matter but...

    GPT has a second (backup) partition table at the end of the disk and I'm not sure if clean deletes that. If you just "clean", "convert mbr" and then format with "quick" the first partition table will be will be overwritten certainly. If you omitted the "quick" the second backup partition table would also be overwritten and could not be retrieved. If you did a "quick" format as mbr knows nothing about the second backup gpt structure it could in theory be retrieved.

    You can't use disk management to do this - you must use diskpart (or third party tool but there is no point really).
    Hi lx07.
    Ive just run into a problem while using Diskpart this weekend to reset a flash drive back to factory. All commands were successful except "Active". It produced an error message "Diskpart has encountered an error. The system cannot find the file specified. See the system event log for more information". At the time of the error there are no errors shown in the system event log. All the other commands were successful.
    You mention above that GPT has a second backup partition table at the end of the disk that has to be deleted.
    Would it be possible to use Diskpart to Clean and Convert MBR only on the USB flash drive and then Close down Diskpart. Then finish the process off using Disk Management to create the New Simple Volume and Full format. Is a Disk Management Full Format exactly the same as a Diskpart Full Format? The reason I'm asking is you said.... "You can't use disk management to do this - you must use diskpart (or third party tool but there is no point really).
      My ComputerSystem Spec

  9.    07 May 2018 #29

    See your PM. Use diskpart:

    select disk 99 (or whatever)
    clean
    convert mbr
    create partition primary
    format fs=fat32 quick label="HELLO" (optional)
    active
    exit

    clean is the important bit (apart from selecting the correct disk obviously)
      My ComputerSystem Spec

  10.    07 May 2018 #30

    lx07 said: View Post
    See your PM. Use diskpart:

    select disk 99 (or whatever)
    clean
    convert mbr
    create partition primary
    format fs=fat32 quick label="HELLO" (optional)
    active
    exit

    clean is the important bit (apart from selecting the correct disk obviously)
    Hi lx07. What about the error message after the Active command? I'm uneasy about that.

    You mention above that GPT has a second backup partition table at the end of the disk that has to be deleted.
    As an alternative method..Would it be possible to use Diskpart to just Clean and Convert MBR on the USB flash drive and then Close down Diskpart. Then finish the process off using Disk Management to create the New Simple Volume and perform the Full format. Is a Disk Management Full Format exactly the same as a Diskpart Full Format? The reason I'm asking is you said.... "You can't use disk management to do this - you must use diskpart (or third party tool but there is no point really).
    The flash drive has been used with Rufus in the past so it had a GPT partition table..you mentioned in your post that a full format not a quick format had to be used in order to be able to completely remove a second backup GPT partition table
      My ComputerSystem Spec


 
Page 3 of 4 FirstFirst 1234 LastLast

Related Threads
I have a Dell laptop Windows 8 upgraded to windows 10 about a year ago. I started having some issues with it so I decided to reset back to factory settings. When I turn it on a blue screen pops up saying, Hi there, lets get a few basic things out of...
Reset Acer Travelmate to factory settings in Installation and Upgrade
Hi all, I have an Acer Travelmate with Win10 (1607), I would like to save Win 10 to a stick, then reset the laptop back to factory settings and then reinstall Win10. There is no program on the laptop that requires saving. Any advice or suggestions,...
Solved Reset to factory settings in Installation and Upgrade
Hi,. I have an HP Envy Phoenix with 1 Tb hard drive....64 bit. It was originally a Windows 7 computer that I upgraded to Windows 10. I decided to do a factory reset and set it to start Friday night andwhenI looked at it Saturday it was still...
Today i decided to reset my pc as program installs had broken and i think i had acquired a virus so i went to setting recovery reset pc and quick reset i left the computer alone for about half an hour assuming it would take time to reset when i came...
Preventing reset to factory settings and similar things in AntiVirus, Firewalls and System Security
Hello, i have a desktop lenovo running windows 10. Ive set a uefi/bios password on there (not clear on the difference) my hope is to prevent resets to factory settings. The end goal being to maintain the integrity of the admin account on the...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 14:00.
Find Us