Status
Not open for further replies.

kikikaka

Member
12
2010
1
10
How to compress files a.avi, b.wmv, c.flv .. with a file xyz.url or xyz.txt and after compression is still a.rar, b.rar, c.rar ...

I have lots file to rar and i need command winrar

i try mtn, UDT but i don't need RENAME feature

thx 4 read and hope u can help me
 
15 comments
Sorry I don't understand what you are asking.

Are you saying you want to compress a.avi & xyz.txt and end up with a.rar?

Are you trying using a batch program or command line or through the winrar GUI?
 
you can use rar.exe (in the winrar installation folder) by using the following attributes :

Code:
RAR 3.70 beta 7   Copyright (c) 1993-2007 Alexander Roshal   16 Apr 2007
Registered to Dias

Usage:     rar <command> -<switch 1> -<switch N> <archive> <files...>
               <@listfiles...> <path_to_extract\>

<Commands>
  a             Add files to archive <------------------------------------------------ Look here
  c             Add archive comment
  cf            Add files comment
  ch            Change archive parameters
  cw            Write archive comment to file
  d             Delete files from archive
  e             Extract files to current directory
  f             Freshen files in archive
  i[par]=<str>  Find string in archives
  k             Lock archive
  l[t,b]        List archive [technical, bare]
  m[f]          Move to archive [files only]
  p             Print file to stdout
  r             Repair archive
  rc            Reconstruct missing volumes
  rn            Rename archived files
  rr[N]         Add data recovery record
  rv[N]         Create recovery volumes
  s[name|-]     Convert archive to or from SFX
  t             Test archive files
  u             Update files in archive
  v[t,b]        Verbosely list archive [technical,bare]
  x             Extract files with full path

<Switches>
  -             Stop switches scanning
  ac            Clear Archive attribute after compression or extraction
  ad            Append archive name to destination path
  ag[format]    Generate archive name using the current date
  ao            Add files with Archive attribute set
  ap<path>      Set path inside archive
  as            Synchronize archive contents
  av            Put authenticity verification (registered versions only)
  av-           Disable authenticity verification check
  c-            Disable comments show
  cfg-          Disable read configuration
  cl            Convert names to lower case
  cu            Convert names to upper case
  df            Delete files after archiving <--------------------------------------- And here
  dh            Open shared files
  ds            Disable name sort for solid archive
  e[+]<attr>    Set file exclude and include attributes
  ed            Do not add empty directories
  en            Do not put 'end of archive' block
  ep            Exclude paths from names
  ep1           Exclude base directory from names
  ep2           Expand paths to full
  ep3           Expand paths to full including the drive letter
  f             Freshen files
  hp[password]  Encrypt both file data and headers
  id[c,d,p,q]   Disable messages
  ieml[addr]    Send archive by email
  ierr          Send all messages to stderr
  ilog[name]    Log errors to file (registered versions only)
  inul          Disable all messages
  ioff          Turn PC off after completing an operation
  isnd          Enable sound
  k             Lock archive
  kb            Keep broken extracted files
  m<0..5>       Set compression level (0-store...3-default...5-maximal)
  mc<par>       Set advanced compression parameters
  md<size>      Dictionary size in KB (64,128,256,512,1024,2048,4096 or A-G)
  ms[ext;ext]   Specify file types to store
  mt<threads>   Set the number of threads
  n<file>       Include only specified file
  n@            Read file names to include from stdin
  n@<list>      Include files in specified list file
  o+            Overwrite existing files
  o-            Do not overwrite existing files
  oc            Set NTFS Compressed attribute
  or            Rename files automatically
  os            Save NTFS streams
  ow            Save or restore file owner and group
  p[password]   Set password
  p-            Do not query password
  r             Recurse subdirectories
  r0            Recurse subdirectories for wildcard names only
  ri<P>[:<S>]   Set priority (0-default,1-min..15-max) and sleep time in ms
  rr[N]         Add data recovery record
  rv[N]         Create recovery volumes
  s[<N>,v[-],e] Create solid archive
  s-            Disable solid archiving
  sc<chr>[obj]  Specify the character set
  sfx[name]     Create SFX archive
  si[name]      Read data from standard input (stdin)
  sl<size>      Process files with size less than specified
  sm<size>      Process files with size more than specified
  t             Test files after archiving
  ta<date>      Process files modified after <date> in YYYYMMDDHHMMSS format
  tb<date>      Process files modified before <date> in YYYYMMDDHHMMSS format
  tk            Keep original archive time
  tl            Set archive time to latest file
  tn<time>      Process files newer than <time>
  to<time>      Process files older than <time>
  ts<m,c,a>[N]  Save or restore file time (modification, creation, access)
  u             Update files
  v             Create volumes with size autodetection or list all volumes
  v<size>[k,b]  Create volumes with size=<size>*1000 [*1024, *1]
  vd            Erase disk contents before creating volume
  ver[n]        File version control
  vn            Use the old style volume naming scheme
  vp            Pause before each volume
  w<path>       Assign work directory
  x<file>       Exclude specified file
  x@            Read file names to exclude from stdin
  x@<list>      Exclude files in specified list file
  y             Assume Yes on all queries
  z[file]       Read archive comment from file

or use something like

Start "C:\Program Files\WinRar\RAR.EXE" a -df -r "E:\MEDIA.RAR" "C:\MEDIA"
 
Ok I am assuming this on a windows machine so create a batch file rar.cmd with this content
Code:
@Echo Off
CLS
FOR /R %%i in (*.*) do ( 
@echo %%i
"c:\program files\winrar\rar" a "%%~ni" "%%~nxi" [COLOR=#3E3E3E][FONT=Verdana] c:\[/FONT][/COLOR][COLOR=#3E3E3E][FONT=Verdana]xyz.url  c:\xyz.txt[/FONT][/COLOR] > NUL)

Run cmd. Then change folder to the folder with the files to archive then type the batch file name c:\rar.cmd or where you placed the batch.
I suggest keeping the batch and the info/txt/url files to be included in the same folder. You must know where the rar.exe is located and make the change in the above line.
 
is there a easier way? :)

that every time i want to rar a file, right click a file add to archive. then it also automatically adds the file i want to be added automatically for example my website url.
 
What are you talking about. It reads the folder for the files then adds the 2 extra files kikikaka wanted.

You can change the name and location of the 2 extra files to the single file you are adding.

Just change these
c:\xyz.url c:\xyz.txt to your file name like c:\yourwebsite.url and it will be added automatically.
 
The syntax for this in Linux is:

Add all files in a directory to a single rar file with the name DesiredArchiveName.rar:
for file in ./*; do rar a DesiredArchiveName.rar $file; done;


Add all files in a directory to a single rar file with the name DesiredArchiveName.rar & split into 1GB parts:
for file in ./*; do rar a DesiredArchiveName.rar $file -v1024M; done;


Create individual rar files of all files in directory:
for file in ./*; do rar a $file.rar $file; done;​
 
Code:
@Echo Off
CLS
FOR /R %%i in (*.*) do ( 
@echo %%i
"c:\program files\winrar\rar" a "%%~ni" "%%~nxi" [COLOR=#3E3E3E][FONT=Verdana] c:\[/FONT][/COLOR][COLOR=#3E3E3E][FONT=Verdana]xyz.url  c:\xyz.txt[/FONT][/COLOR] > NUL)

can you edit these codes to have these:
-compression method to "store"
-split to volumes to "1024mb"
-put each files to separate archive
-load a comment from a .txt

thanks!
 
try this
Code:
@Echo Off
CLS
FOR /R %%i in (*.*) do ( 
@echo %%i
"c:\program files\winrar\rar" a -m0 -v1024m "%%~ni" "%%~nxi" [COLOR=#3E3E3E][FONT=Verdana]c:\xyz.txt[/FONT][/COLOR] > NUL)
 
@Lock Down it is working in my desktop. but when i use it in my RDP these always gets deleted: c:\xyz.url c:\xyz.txt
and it also does not make the file as .rar . for example i tried it in 123.mp4 it ended up as "123" not as rar.

thanks!
 
That means you have an old file somewhere that it is running.

Create a new cmd file called batchrar.cmd with the last code I gave you and the try it.

Also be sure that the rar.exe is in c:\program files\winrar folder

If you can't get it to work pm me the rdp login and I will check it.
 
fixed: it does not delete these anymore: c:\xyz.url c:\xyz.txt

but still it cannot make the file extension to .rar .. all files that have been archive does not have file extension

thanks!
 
yes exactly. files that have .url are okay but those files with avi,mkv and mp4 extensions when rar'd have problems. they dont have .rar extension.

thanks!
 
Sorry I have done all types and don't have that problem. make sure you downloaded the latest version of rar and that you do not have disk space or volume hard drive problems.

I would like to see it run as I know it is not the script.

Change this @Echo Off to @Echo On and remove this > NUL


Then test it again in a cmd window and look for the errors..
 
Last edited:
Status
Not open for further replies.
Back
Top