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

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
LVL 1
brandscoAsked:
Who is Participating?
 
Rajkumar GsConnect With a Mentor Software EngineerCommented:
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
 
Rajkumar GsSoftware EngineerCommented:
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
 
Rajkumar GsSoftware EngineerCommented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Rajkumar GsSoftware EngineerCommented:
Also make sure to give correct location of WinRAR installation folder in the command.

Raj
0
 
brandscoAuthor Commented:
raj, i followed your instuctions and successfully i am able to do that..
thank you
0
 
Rajkumar GsSoftware EngineerCommented:
Glad I could help
Raj
0
 
brandscoAuthor Commented:
raj, when i try to extract the folder that i archived it is asking for a password
0
 
Rajkumar GsSoftware EngineerCommented:
one minute. i will check
0
 
Rajkumar GsSoftware EngineerCommented:
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
 
brandscoAuthor Commented:
Ok Got it.. pwd was Test... Thank U Raj... Solution Accepted Already..

Regards
Syed Mohammed Sirajuddin
0
 
Rajkumar GsSoftware EngineerCommented:
Take care
Enjoy the week end :)
Raj
0
All Courses

From novice to tech pro — start learning today.