Open CarolineClark opened 9 years ago
The problem is with this line, which takes only the last character of the DeviceID. If the system has more than 10 drives attached (e.g. the user has a multi-card reader) and selects, for example, the drive with DeviceID=\.\PHYSICALDRIVE12, the tool will select the last character and format drive 2. A solution would be to replace the offending line with something like this:
drivenum = output_lines[index].lower().find('physicaldrive') + len('physicaldrive')
id = output_lines[index][drivenum:]
I moved everything to lower case because I don't know if WMI uses the same casing on all systems.
As a side note, id is a Python built-in function, so it might be a good idea to rename that variable.
Bump. I've submitted a pull request that fixes this issue (#24).
This was merged (Thanks @elyscape !) But I think there was one place where the single digit disk id was still being used: format_disk(). I' have made a fix here: https://github.com/KanoComputing/kano-burners/commit/dc3751ca8bba634dca55fb52881b5b028a42d816
@rluz @FMog Does either of you have a multi-in-one card reader writer ? If not we need to acquire one before this can be tested. This fault is caused by having a card reader which appears to windows as so many disks that there are 10 disks, so we ended writing to disk 0 instead of disk 10.
@Ealdwulf I have a multi card reader, I can bring it tomorrow.
We had a report of a customer wiping his 1TB internal hard drive after apparently selecting the SD card in the dropdown list. We need to verify the disk selected is the disk we're formatting and burning.