Solved

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

Posted on 2011-02-26
11
855 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
  • 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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