Solved

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

Posted on 2011-02-26
11
858 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
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

 
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Good afternoon all, We are running a VM infrastructure on a clustered ESX environment with two DELL R710's.  One of our IT Application Support Engineers contacted me and asked if it was possible to extend the partition of a certain Windows 2003 S…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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…

752 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