MSFN Forum: add multipar to my batch file - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

add multipar to my batch file hello yzöwl this is especially for you :) Rate Topic: -----

#1 User is offline   darksimoon 

  • Member
  • PipPip
  • Group: Members
  • Posts: 111
  • Joined: 29-May 05

Posted 27 February 2013 - 01:54 AM

Hello dear friends;
You helped me a lot in the past about batch files and now i need your help one more time.
I am creating a batch file for my photograp back ups which will make md5 hash files firstly,
then create parity files and latest write to DVD.
I managed to do for md5 and dvd writing but as for parity files i have difficulty.
I am using multipar for this which supports commnad line.
But in the batch files it only accepts the files at the root of the folder and ignore the files at the subfolders.
They gave a sample batch for this but i cant add this into my batch files.
please help me to add multipar batch file which accepts the files at the subfolders as well to my backup batch file.
best regards...



My batch files is;
======================backup======================================
:create hash file within each folder
"%ProgramFiles%\FastSum\fsum.exe" c:\denemesum /R /T:F /I:DT

:create hash file at the root
"%ProgramFiles%\FastSum\fsum.exe" c:\denemesum /R /T:R /I:DT /O

: create parity files
????????????????????

:create iso file
"%ProgramFiles%\ImgBurn\Imgburn.exe" /mode build /buildmode imagefile /src "C:\denemesum\" /dest "%homepath%\Desktop\PhotoBackUp.iso" /FILESYSTEM "ISO9660 + Joliet" /VOLUMELABEL "BACKUP%DATE%" /rootfolder yes /start /close /LOG ".\PhotoBackup_[DATE]-[TIME].log"

==================================================================


multipar batch file which creates individual PAR2 set in each sub-folder under a selected folder;
========================multipar==================================
@ECHO OFF
SETLOCAL

REM check input path
IF "%~1"=="" GOTO End
IF NOT EXIST "%~1" (
ECHO The path does not exist.
GOTO End
)
IF NOT "%~z1"=="0" GOTO End

REM set options for PAR2 client
SET par2_path="path of par2j.exe"

REM recursive search of sub folders
PUSHD %1
FOR /D /R %%G IN (*.*) DO CALL :ProcEach "%%G"
POPD

GOTO End

REM run PAR2 client
:ProcEach
ECHO create for %1
%par2_path% c /fo /sm2048 /rr20 /rd1 /rf3 "%~1\%~n1.par2" *

GOTO :EOF

:End
ENDLOCAL
==================================================================

Attached File(s)




#2 User is offline   bphlpt 

  • MSFN Expert
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 1,075
  • Joined: 12-May 07

Posted 27 February 2013 - 10:40 AM

What have you tried? What happened? In the line -- SET par2_path="path of par2j.exe" -- did you change "path of par2j.exe" to the real path of "par2j.exe"? You have to do that.

Then, save the multipar batch code above between the lines of ===multipar== as multipar.cmd and put it in the same folder as your backup batch file. Then in your backup batch file, change the line ???????????????????? to "CALL multipar.cmd c:\denemesum", without the quotes. If it does not work, what does happen, exactly?

I have NOT tried this, but it should work if I understand the code correctly. I also assumed that the files you want to process are all in the folder "c:\denemesum".

Cheers and Regards

#3 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,363
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 27 February 2013 - 01:42 PM

Why are you creating MD5 hashes and parity files?

I would suggest that any file corruption in your 'burned' ISO will also bring into question the validity of the hashes and parity files also burned within!

Why not just burn your ISO with verification?

#4 User is offline   darksimoon 

  • Member
  • PipPip
  • Group: Members
  • Posts: 111
  • Joined: 29-May 05

Posted 28 February 2013 - 01:56 AM

hello friends;
@bphlpt,
actually i changed the "path of par2j.exe" but somehow i couldn't manage. in the help file it was saying that just drag the folder onto the batch file. i tried but failed. however i will try your solution and inform you.

@yzöwl, yes you are right. i am new to backup procesess. i think that corruption on CD is happening partially. in such case i may detect corrupted files by checking md5 hash files and rescue corrupted files with parity files.
now i see that it is better keep the md5 files at both CD and another location & parity files in another location as well.
i will backup especially my photographs which are very valueable for me. in this case what would you recommend to me ?
(i will already have a copy of photograps in other external HDD. writing CD is part of photography backup. this is why writing CD is very important for me.)

best regards...

#5 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,363
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 28 February 2013 - 01:50 PM

View Postdarksimoon, on 27 February 2013 - 01:54 AM, said:


IF NOT "%~z1"=="0" GOTO End



If the input file size does not equal zero end the batch file!

I would suggest you remove NOT and try again!

#6 User is offline   darksimoon 

  • Member
  • PipPip
  • Group: Members
  • Posts: 111
  • Joined: 29-May 05

Posted 01 March 2013 - 03:38 AM

hello friends;
thank you both a lot.

i made the correction suggested by yzöwl first. and this time it worked. :)
then i did what bphlpt told me to try and it all worked together very well.
i am so happy. :) thank you very much one more time.
i attached the files as sample for people who might need them.
best regards...

Attached File(s)


This post has been edited by darksimoon: 01 March 2013 - 03:39 AM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy