You are not logged in.
Pages: 1
Hi, i am trying to write a script which will format more then just one flash disk.
here is the script for one disk but i would like to format more in once.
format f: /fs:FAT32 /v:Something /q
sure i know then i wrote another line with different volume it will be fine. But when i do that. It will force me to push Enter again and i don't want that.
How it should work: I put 4 disc to the HUB and start the *.bat. It will format all of those disc and copy there same folders. I am using Xcopy command.
Any idea how to do it? THX for ur replays.
Robin
And sorry for my misteaks in English... It's not my language.
Offline
This tool may be better if you run it with admin permssions. http://www.ridgecrop.demon.co.uk/fat32format.htm
Offline
I don't have a flash drive to hand that I'd care to test this on, but maybe you could do something like this?
@echo off
REM list of assigned drive letters (be careful!)
set "drives=f g h i"
REM location to place a temporary answer file
set "answer=%temp%\answer.txt"
REM place a notional "Enter" key press into the answer file
echo:>"%answer%"
REM loop through all drives listed
for %%a in (%drives%) do (
REM run format command, reading the "Enter" key press back from the answer file
REM see: http://ss64.com/nt/syntax-redirection.html
format %%a: /fs:FAT32 /v:Something /q < "%answer%"
)
REM tidy up
del "%answer%" 2>nul
Last edited by bluesxman (30 Dec 2014 15:23)
cmd | *sh | ruby | chef
Offline
Bluesxman: thx it works perfectly... I was thinking about for today. But never works for me. It was just shorter code but it asked for Enter allways... so hoestly i don't know how u did it. I don't understand the code. To be more exact the part with answer but it works. If u be so nice and u'll explain that to me i'll be glad, if not i'll understand it. however really thanks. It save me a lot of time in work. Robin
Offline
I've edited my post above to add explanatory comments throughout.
Last edited by bluesxman (23 Dec 2014 12:25)
cmd | *sh | ruby | chef
Offline
I've edited my post above
You set the drives variable but it is not used. Just sayin'
Last edited by foxidrive (23 Dec 2014 16:31)
Offline
bluesxman wrote:I've edited my post above
You set the drives variable but it is not used. Just sayin'
Whoops! Retconned.
Last edited by bluesxman (30 Dec 2014 15:23)
cmd | *sh | ruby | chef
Offline
Pages: 1