AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Questions about Winrar

 
Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
Da Rossa



Joined: 06 Dec 2007
Posts: 361

PostPosted: Fri Nov 27, 2009 2:40 am    Post subject: Questions about Winrar Reply with quote

Hi ahk masters.

I have a little AHK project in mind and part of it includes the compressing (rar.exe) function of WINRAR. Since this is not mainly about ahk I decided to post it here.

About the rar command there is one inconvenience: When I use this command-line entry...

Code:
D:\Testes\torar>rar a D:\Testes\torar\rarei.rar D:\Testes\torar\*.txt


...to put all the .txt files in the directory "torar" in a .rar archive, the resulting .rar pack will have, inside, exactly the same full directory tree from where the file was created. For example: if my .txt files are in the following folder,

Code:
C:\documents\level 1\level 2\level 3


...the rar will create all this folders, in that same hierarchy (documents - level 1 - level 2 - level 3) and only then the .txt files.

Question for now: what is the parameter or any other solution to have rar.exe create the rar in the current direcory level, without creating the full matching tree? Thanks in advance.
_________________
AHK is perfect.
Back to top
View user's profile Send private message
haichen



Joined: 05 Feb 2007
Posts: 189
Location: Osnabrück, Germany

PostPosted: Fri Nov 27, 2009 1:52 pm    Post subject: Reply with quote

Code:
RAR.exe a -ep1 test torar\*


Have a look at the helpfile under command line syntax -> switches
Back to top
View user's profile Send private message
Da Rossa



Joined: 06 Dec 2007
Posts: 361

PostPosted: Sat Nov 28, 2009 8:17 pm    Post subject: Reply with quote

There is no helpfile! Sad
I searched around the web and found very little documentation about the command line functions. My main help is the command list that shows up when I simple type "rar" at the command prompt.

Thanks! This removed the full tree above the files.

What is the switch/parameter I use to include all subfolders, with no exception or depth limit, in the archive?

Thanks in advance haichen.
_________________
AHK is perfect.
Back to top
View user's profile Send private message
Tuncay



Joined: 07 Nov 2006
Posts: 1886
Location: Germany

PostPosted: Sat Nov 28, 2009 9:52 pm    Post subject: Reply with quote

Here http://www.scribd.com/doc/15681481/Rar I found a full documentation. It can be downloaded in plain text and in pdf formats, BUT only after registration. Rolling Eyes Evil or Very Mad for reading it online, no registration is needed.
_________________
{1:"ahkstdlib", 2:"my libs", 3:"my apps", 4:"my license"}
--> Don't feed the troll! <--
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Da Rossa



Joined: 06 Dec 2007
Posts: 361

PostPosted: Sun Nov 29, 2009 1:46 am    Post subject: Reply with quote

Thanks! I am already registered, so I got the pdf. Nice.

There I could see the list of switches, and the closest to what I want is the -r. So the command got like:

Code:
rar a -ep -r letras @lista.lst


But, although it includes files in subdirectories, the directory hierarchy is not mantained, and the resulting archive will have all files in the same level. for example: I have a folder called "lyrics", in which I keep some txt files, such as: song1.txt and song2.txt. Inside, I have a subfolder called "rock", where I keep the files rocksong1.txt and rocksong2.txt.

After performing the above command, the resulting archive will have the following list
song1.txt
song2.txt
rocksong1.txt
rocksong2.txt

instead of...

song1.txt
song2.txt
rock\rocksong1.txt
rock\rocksong2.txt

Got it?

How to fix that?
_________________
AHK is perfect.
Back to top
View user's profile Send private message
haichen



Joined: 05 Feb 2007
Posts: 189
Location: Osnabrück, Germany

PostPosted: Sun Nov 29, 2009 11:26 pm    Post subject: Reply with quote

If you install winrar there is a helpfile winrar.chm in the program dir.
You can also get access to it in winrar->Help->help topics

And if you want to maintain directories there are two ways:
Code:
RAR.exe a -r -ep1 test torar\*

or
you make a bat like this
Code:
cd torar
rem go into the dir
RAR.exe a -r  ..\test
rem add rekursiv (-r) files and dirs to a test.rar  and save it one directory above (..\)

I tested this and both variants are working

You can add C:\Program Files\WinRAR to your PATH so you don't have to copy rar.exe
Back to top
View user's profile Send private message
Da Rossa



Joined: 06 Dec 2007
Posts: 361

PostPosted: Sat Dec 05, 2009 9:19 pm    Post subject: Reply with quote

Thanks a lot man!
And I'm sorry for late feedback.

I was successful at RAR'ing the current directory with all subdirs included with the following command:

Code:
RAR a -r -ep1 torarando.rar


But since I'm too noob for CMD and DOS, I don't know what "add to the path" is. I'm sorry, what is it? Does it have anything to do with the "working dir"? Only so I will be able to understand this bat:

Code:
cd torar
rem go into the dir
RAR.exe a -r  ..\test
rem add rekursiv (-r) files and dirs to a test.rar  and save it one directory above (..\)


Thanks!
_________________
AHK is perfect.
Back to top
View user's profile Send private message
haichen



Joined: 05 Feb 2007
Posts: 189
Location: Osnabrück, Germany

PostPosted: Sun Dec 06, 2009 1:32 am    Post subject: Reply with quote

Open a DOS-box and type set. You get all environmentvariables. One of them is path.
Path is used to specify the location where MS-DOS looks when using a command. So you don't have to use the full adress in a DOS-script, like c:\windows\notepad.exe. You can start the program with it's name.
Type notepad in the dos box and you see what i mean.
Open Control Panel-Performance and Maintenance-System (or right-click on My Computer and choose "Properties"). In the box that opens, click the "Advanced" tab to obtain the dialog box shown below.
Next, click the button "Environment Variables". Here you can change the path variable.
For Winrar you add ;c:\program files\winrar (or whereever you installed it) to the end.
From now you can use the command rar.exe from every directory without preceding c:\program files\winrar\

Another Way to change the path var can be done in the bat file.
Write path = %PATH%;c:\program files\winrar in your .bat file. This changes the Path only for this script.

Nice link: http://www.computerhope.com/msdos.htm
Back to top
View user's profile Send private message
Da Rossa



Joined: 06 Dec 2007
Posts: 361

PostPosted: Sun Jan 03, 2010 3:30 am    Post subject: Reply with quote

Thanks a lot bro!
And sorry for the long waiting.
Now I understand why some programs can be called directly while others need absolute path.

Just one question: what if I add hundreds of programs to the path, will I experience a performance loss?
_________________
AHK is perfect.
Back to top
View user's profile Send private message
haichen



Joined: 05 Feb 2007
Posts: 189
Location: Osnabrück, Germany

PostPosted: Sun Jan 03, 2010 10:22 am    Post subject: Reply with quote

I don't think there is the needing to set a pathvar for hundreds of files.
You only need to set a path for programs you want to start from DOS-boxes,
and only when you want to start this program from a Dir that is not the programs Dir.
And some Systemdirectories are already in the PATH.
Back to top
View user's profile Send private message
Da Rossa



Joined: 06 Dec 2007
Posts: 361

PostPosted: Sun Jan 03, 2010 6:38 pm    Post subject: Reply with quote

Thanks a lot. Smile
_________________
AHK is perfect.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> General Chat All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group