Re: [python-win32] Write to address on PhysicalDisk

2009-11-30 Thread Joe Grado
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

Re: [python-win32] Write to address on PhysicalDisk

2009-11-28 Thread Tim Roberts
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

[python-win32] Write to address on PhysicalDisk

2009-11-28 Thread Joe Grado
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