It appears you need to use the win32 interface for write access to
physical drives. CAUTION: This code writes over the first sector of a
USB drive.
for physical_disk in c.Win32_DiskDrive (Index=1,InterfaceType='USB'):
sector_size = int(physical_disk.BytesPerSector)
total_sector
You wrote:
>
>I am trying to zero an entire usb drive including the boot sector. The
>code below works perfect but if I try to open the drive in write
>mode(wb) then I get this error message:
>
>IOError: [Errno 2] No such file or directory: u'.\\PHYSICALDRIVE1'
Are you running as administrator
I am trying to zero an entire usb drive including the boot sector. The
code below works perfect but if I try to open the drive in write
mode(wb) then I get this error message:
IOError: [Errno 2] No such file or directory: u'.\\PHYSICALDRIVE1'
Code: Select all
import binascii
import wm