Hello,
This is what I want to do,
- insert USB flash drive.
- mount it.
- record uniquie identifer string to a file.
- format the drive to FAT32.
- copy a text file to the drive.
- unmount it.
- remove the drive.
30 times
The situation is this, I have bought 30 usb drives. I need to format each one to ensure they are clean, I need the unique string from each device. I need to put the same txt file on each one.
I am not great at writing scripts but can read and follow bash and python.
Any pointers would be appreciated.
edit
Thank you for your resposes.
Here is what I have got so far, in windows.
I used USBDeview from nirsoft.net options > advanced options > "execute the following command when you insert a USB device" and used the following command "python getserial.py %serial_number%"
the getserial.py script puts the %serial_number% passed from USBDeview into a text file, then copies a file to the USB device.
import sys
import shutil
sourceFile = "C:\\^READ ME.txt"
destinationFile = "E:\\^READ ME.txt"
f = open('serials.txt', 'a')
f.write(sys.argv[1] + '\n')
f.close()
from time import sleep
sleep(3)
shutil.copyfile(sourceFile, destinationFile)
Would still be interested in a full script that could do this but I think it is beyond my capabilities at the moment.