Solved

Winrar Command line help. Archive folders into .rar to a specific location

Posted on 2011-02-26
11
860 Views
Last Modified: 2013-12-01
Hi,

I am trying to create a batchfile that will copy a folder and its complete files and subdirectories. and then those files must be archived using winrar to a specific location. The scenario is as given below.

SOURCE: \\192.168.0.3\d$\Ebiz
where Ebiz is the folder that i am trying to archive.

DESTINATION: \\192.168.0.2\d$\EBIZ_BKP\%CURRENT DATE%
where current date must be the file name

Is it possible? Please help.

Thank You
0
Comment
Question by:brandsco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 3
11 Comments
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34986909
I have tried previously in one of my VB 6.0 application, the WinRAR command utility
Source - http://forums.techguy.org/all-other-software/704527-solved-winrar-command-line-question.html

What about this command ?
"C:\Program Files\WinRAR\rar.exe" a -m5 -ed -pTest \\192.168.0.3\d$\Ebiz \192.168.0.2\d$\EBIZ_BKP\

Open in new window


Raj
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34986911
I think, enclose with double-quotes is correct
"C:\Program Files\WinRAR\rar.exe" a -m5 -ed -pTest "\\192.168.0.3\d$\Ebiz" "\192.168.0.2\d$\EBIZ_BKP\"

Open in new window

Make sure you have write permission to the network folder

Raj
0
 
LVL 23

Accepted Solution

by:
Rajkumar Gs earned 500 total points
ID: 34986915
Updated for file name with current date
"C:\Program Files\WinRAR\rar.exe" a -m5 -ed -ag[dd.MM.yyyy] -pTest "\\192.168.0.3\d$\Ebiz" "\192.168.0.2\d$\EBIZ_BKP\"

Open in new window


I believe, if it not working, with some modifications you could find the solution

Raj
0
Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34986920
Also make sure to give correct location of WinRAR installation folder in the command.

Raj
0
 
LVL 1

Author Comment

by:brandsco
ID: 34987105
raj, i followed your instuctions and successfully i am able to do that..
thank you
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34987113
Glad I could help
Raj
0
 
LVL 1

Author Comment

by:brandsco
ID: 34987114
raj, when i try to extract the folder that i archived it is asking for a password
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34987138
one minute. i will check
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34987156
Oops!

In the command to create archieve, a password was set (see -pTest   means a password is set as 'Test' )
If you don't want password, modify command by remove that session
"C:\Program Files\WinRAR\rar.exe" a -m5 -ed -ag[dd.MM.yyyy] "\\192.168.0.3\d$\Ebiz" "\192.168.0.2\d$\EBIZ_BKP\"

Open in new window


Right now, if you extract your current archieve, provide -pTest to your extract command as well - becase that password is set to archive
Add -pTest to your archieve command line

I am sure, this will solve this issue.
Raj
0
 
LVL 1

Author Comment

by:brandsco
ID: 34987274
Ok Got it.. pwd was Test... Thank U Raj... Solution Accepted Already..

Regards
Syed Mohammed Sirajuddin
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
ID: 34987283
Take care
Enjoy the week end :)
Raj
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what hardware you have and get the most up to date drivers from the manufacturer! Automatically Get Your Drivers There is a number of great programs that will detect your hardware and find drivers for you automatically! Here is a link …
I wrote an article (http://www.experts-exchange.com/articles/2245/Anti-rootkit-software.html) some time ago with a reference to nLite  (http://www.nliteos.com/)slipstreaming software.  I recently changed that link to point to NTLite (https://www.ntl…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question