• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

Hi dampsey , I used ur code , its running fine without error but txt files are not extracting

Hi dampsey ,

                     Thank you for ur reply . I have export.rar file  in  this path "D:\Web\VENUS\MINERVA\UPLOADFILES\export.rar" .This rar file having five txt files. I have to unrar that five text file to this path   "D:\Web\VENUS\MINERVA\OLD\" . I copied that unrar.exe in my web application(SANDS). i didnt created any folder, directly i added to (D:\softworkingfolder\SANDS\)
 I used ur code , its running fine without error but txt files are not extracting to  "D:\Web\VENUS\MINERVA\OLD\"

   string arguments = " a -ep \"" + @"D:\Web\VENUS\MINERVA\OLD\" + "\" \"" + @"D:\Web\VENUS\MINERVA\UPLOADFILES\export.rar" + "\"";
            ProcessStartInfo inf = new ProcessStartInfo("UnRAR.exe", arguments);
            inf.WorkingDirectory = @"D:\softworkingfolder\SANDS\" + "\\";
            inf.WindowStyle = ProcessWindowStyle.Hidden;

            Process islem = new Process();
            islem.StartInfo = inf;
            islem.Start();
            islem.WaitForExit();
0
dilipsjain
Asked:
dilipsjain
1 Solution
 
abelCommented:
you use "-ep", that means "exclude paths". But you are saying that you actually want to extract to that path, instead of excluding it from unrarring. Then, the "a" command is from rar.exe, not from unrar.exe, and means to add to the archive.

Assuming that you want to extract tot he directory you mentioned, here's an alternative commandline:





// unrar e source.rar target\directory\
string arguments = @" e ""D:\Web\VENUS\MINERVA\UPLOADFILES\export.rar"" ""D:\Web\VENUS\MINERVA\OLD\""";
ProcessStartInfo inf = new ProcessStartInfo("UnRAR.exe", arguments);
 
//.... etc

Open in new window

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now