Sie sind auf Seite 1von 2

---------------mkh.

mourad batch script


C:\Users\Hisam\Downloads\Converter>rem run ImgToTar.md5.batch instead of this ba
tch file for creating a log file of the operation.
C:\Users\Hisam\Downloads\Converter>rem clean directoies from old tar and tar.md5
files
C:\Users\Hisam\Downloads\Converter>FOR /F "delims=" %G in ('DIR /S /A:-D /B *.ta
r') do del "%G"
No se encuentra el archivo
C:\Users\Hisam\Downloads\Converter>FOR /F "delims=" %G in ('DIR /S /A:-D /B *.ta
r.md5') do del "%G"
No se encuentra el archivo
C:\Users\Hisam\Downloads\Converter>rem first create a backup files from *.img in
the same directory
C:\Users\Hisam\Downloads\Converter>FOR /F "delims=" %G in ('DIR /S /A:-D /B *.im
g *.bin') do XCOPY /Y "%G" "%G.back" 0<Yes_File
C:\Users\Hisam\Downloads\Converter>XCOPY /Y "C:\Users\Hisam\Downloads\Converter
\recovery.img" "C:\Users\Hisam\Downloads\Converter\recovery.img.back" 0<Yes_Fil
e
El sistema no puede encontrar el archivo especificado.
C:\Users\Hisam\Downloads\Converter>rem rename img files started by recovery to r
ecovery.img and
C:\Users\Hisam\Downloads\Converter>rem img files started by boot or kernel to bo
ot.img
C:\Users\Hisam\Downloads\Converter>FOR /F "delims=" %G in ('DIR /S /A:-D /B reco
very*.img') do REN "%G" recovery.img
C:\Users\Hisam\Downloads\Converter>REN "C:\Users\Hisam\Downloads\Converter\recov
ery.img" recovery.img
C:\Users\Hisam\Downloads\Converter>FOR /F "delims=" %G in ('DIR /S /A:-D /B boot
*.img') do REN "%G" boot.img
No se encuentra el archivo
C:\Users\Hisam\Downloads\Converter>FOR /F "delims=" %G in ('DIR /S /A:-D /B kern
el*.img') do REN "%G" boot.img
No se encuentra el archivo
C:\Users\Hisam\Downloads\Converter>FOR /F "delims=" %G in ('DIR /S /A:-D /B mode
m*.bin') do REN "%G" modem.bin
No se encuentra el archivo
C:\Users\Hisam\Downloads\Converter>rem Create the tar file:
C:\Users\Hisam\Downloads\Converter>SETLOCAL ENABLEDELAYEDEXPANSION
C:\Users\Hisam\Downloads\Converter>call set curentDir="C:\Users\Hisam\Downloads\
Converter"
C:\Users\Hisam\Downloads\Converter>FOR /F "delims=" %G in ('DIR /S /A:-D /B *.im
g *.bin') do (

call cd %~dpG
call !curentDir!\BIN\tar --create --format=gnu -b20 --quoting-style=escape --ow
ner=0 --group=0 --totals --mode=644 -f %~nG.tar %~nxG
)
C:\Users\Hisam\Downloads\Converter>(
call cd C:\Users\Hisam\Downloads\Converter\
call !curentDir!\BIN\tar --create --format=gnu -b20 --quoting-style=escape --ow
ner=0 --group=0 --totals --mode=644 -f recovery.tar recovery.img
)
Total bytes written: 7075840 (6.8MiB, 119MiB/s)
C:\Users\Hisam\Downloads\Converter>cd !curentDir!
C:\Users\Hisam\Downloads\Converter>rem Create the md5 final file:
C:\Users\Hisam\Downloads\Converter>FOR /F "delims=" %G in ('DIR /S /A:-D /B *.ta
r') do (
call cd %~dpG
call !curentDir!\BIN\md5sum -t %~nxG 1>>%~nxG
call !curentDir!\BIN\mv %~nxG %~nxG.md5
)
C:\Users\Hisam\Downloads\Converter>(
call cd C:\Users\Hisam\Downloads\Converter\
call !curentDir!\BIN\md5sum -t recovery.tar 1>>recovery.tar
call !curentDir!\BIN\mv recovery.tar recovery.tar.md5
)
C:\Users\Hisam\Downloads\Converter>cd !curentDir!
C:\Users\Hisam\Downloads\Converter>rem clean directoies from img files
C:\Users\Hisam\Downloads\Converter>FOR /F "delims=" %G in ('DIR /S /A:-D /B *.im
g *.bin') do del "%G"
C:\Users\Hisam\Downloads\Converter>del "C:\Users\Hisam\Downloads\Converter\recov
ery.img"

Das könnte Ihnen auch gefallen