Format a drive ... ?

Started by mhall, June 09, 2014, 10:49:02 PM

Previous topic - Next topic

mhall

Hi All,

Quick question with a hopefully simple answer.

Can I format a drive with WinBatch?

More specifically, what I want to do is format a collection of CF cards and create the default directory structure needed on them for our cameras.

Currently, I format each card in camera prior to a shoot ... but I quite literally have several hundred cards and that can take an hour or more ... and I usually remember that I have to do it around 1am the night prior to an event that is scheduled to start the next morning and that's no fun.  ::) We keep this many cards on hand because we do not re-use the card during an event. It gives us a fallback in case of drive failure or in case of a mixup (e.g., mislabeling when downloading). But it does add to admin burden after an event.

Instead, I would like to hook up our CF readers (we have 24 available attached in groups of 4 to USB hubs) to a couple of machines, insert CF cards into each and format each CF card in turn, change out the cards and repeat until done. Doing 24 at a time should make this much faster!

I can easily get a list of attached removable drives and inspect them for the DCIM folder to make sure I'm dealing with a CF card, but I've been poking around the help files and haven't seen an option for formatting. Ideally, I'd be able to specify Quick or Full Format and file system type (FAT32 in this case).

Any help topics I should be searching for? I've been looking under format, drive format, disk format, format drive, format disk, etc. I've looked at the ShellExtender and generally been poking around the help files, but no joy.

I was thinking I could script fdisk ... but that's not included in Windows 7 any longer ...

Any pointers, tips or suggestions?

Thanks!
Micheal

Deana

There is no format function built into WinBatch itself. In earlier windows platforms you could use the ShFormatDrive function, however that API doesn't seem to be supported on Windows 7.
: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/Floppy~and~CD~Drives+Format~a~Drive~with~More~Options.txt.

The WMI Win32_Volume class seems to have a Format method, however the documentation seems to indicate it is only supported on Windows Servers not Clients.
http://msdn.microsoft.com/en-us/library/aa390432%28v=VS.85%29.aspx.

So you might want to RunWait / ShellExecute the Command Shells (cmd.exe) FORMAT command to format a drive: http://technet.microsoft.com/en-us/library/cc730730.aspx. See also: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/How~To+Format~a~disk~on~Windows~2000~or~Windows~XP.txt
Deana F.
Technical Support
Wilson WindowWare Inc.

mhall

Thanks Deana, I'll certainly check it out.