1.

Solve : Winrar help?

Answer»

Hi,

I am Using Windows Xp, i trying to CREATE a new batch file which will do, compress a text file and delete after archive.
my existing batch file content is below

set path="C:\Program Files (x86)\WinRAR\";%path%
rar a -df -ep -mt2 C:\Test20110503.rar C:\Griddatafortheperiod20110503.txt
pause

I need archive file name as like the source file name(Griddatafortheperiod20110503.txt)
Current Archive file name is Test20110503.rar. please tell me how to create a archive file name as like source file name?

Thank you

ShanQuote

I need archive file name as like the source file name(Griddatafortheperiod20110503.txt)

This should LET you specify the name for both. Is this what you need?

Code: [Select]set path="C:\Program Files (x86)\WinRAR\";%path%
set /p textfile=Type the name of the file:
rar a -df -ep -mt2 C:\%textfile%.rar C:\%textfile%.txt
pause
I READ your question again, and I think I might have MISINTERPRETED your question. Do you want the batch to scan the folder for all text files and compress each one into a .rar file?Hi Linux711,

Thanks for your immediate reply... i TRIED your code its working fine for me and i got the result as i needed. thanks...

Shan


Discussion

No Comment Found