Solved

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

Posted on 2011-02-26
11
849 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 23

Expert Comment

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

Raj
0
 
LVL 1

Author Comment

by:brandsco
Comment Utility
raj, i followed your instuctions and successfully i am able to do that..
thank you
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 23

Expert Comment

by:Rajkumar Gs
Comment Utility
Glad I could help
Raj
0
 
LVL 1

Author Comment

by:brandsco
Comment Utility
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
Comment Utility
one minute. i will check
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
Comment Utility
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
Comment Utility
Ok Got it.. pwd was Test... Thank U Raj... Solution Accepted Already..

Regards
Syed Mohammed Sirajuddin
0
 
LVL 23

Expert Comment

by:Rajkumar Gs
Comment Utility
Take care
Enjoy the week end :)
Raj
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
robocopy 6 49
How to Force Windows XP to Scan for driver update 14 72
Batch to Restart Remote Computers 4 57
move command 5 29
It is a common problem that often server suffers from the lack of space on system volume. Old servers or new ones from vendors come with preformatted small volume - 5-6GB in total and after installing updates or applications the free space on system…
In this article we have discussed the manual scenarios to recover data from Windows 10 through some backup and recovery tools which are offered by it.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now