For this to work your WinRAR installation (default location: C:\Program Files\WinRAR) should have rar.exe and unrar.exe files which are installed by default when installing WinRAR software.
For this Example my document structure is as follows,
\core
abc.rar
Given bellow is the example code for extracting a rar file named abc into the folder called core. Commands marked in bold will actually perform the operation.
- First we must set the path to rar.exe or unrar.exe which we are going to use. In this case its unrar.exe
set path="C:\Program Files\WinRAR\";%path% - Then we must give the path into which your rar file should be extracted.
cd /d C:\WinRAR_Test\core - Then we must give the location of the rar file to be extracted.
unrar x ../abc.rar
In here if we use the command as 'unrar e' all the files in all the folders of the rar file will be extraced to the folder mentioned in the step 2. But if we use the command as 'unrar x' we will be able to preserve the folder structure while extracting.
Given below is the completed batch program which need to be saved in a text file and renamed as somename.bat and double clicked to execute.
Hope you enjoyed this piece of code as much as I do!@echo off@echo Extracting the file..set path="C:\Program Files\WinRAR\";%path%cd /d $INSTALL_PATH\coreunrar x ../abc.rar@echo all files extracted
Reference: http://www.respower.com/page_tutorial_unrar
this helped me very well.pls add more programs about conversion in batch file
ReplyDeleteexcellent piece of information, I had come to know about your website from my friend kishore, pune,i have read atleast 8 posts of yours by now, and let me tell you, your site gives the best and the most interesting information. This is just the kind of information that i had been looking for, i'm already your rss reader now and i would regularly watch out for the new posts, once again hats off to you! Thanx a lot once again, Regards, Marathi Jokes in Marathi Language
ReplyDeleteNice......
ReplyDeleteHello, Need help I'm a bit confused
ReplyDeleteYeah same its really annoying, every time I make it extract it doesn't extract and nothing happens
Delete