Page 1 of 1

[Windows 2003] Simple script HELP

Posted: January 18th, 2011, 8:49 pm
by OfficerDoofy
Hi, can anyone tell what i have to put in .bat file to archive my upload with winrar after download? What i want is to download file from usenet, unrar it and rar it again with that script but in larger archive... Thanks in advance..

Edit : I am using winrar for archiving...

Re: [Windows 2003] Simple script HELP

Posted: January 20th, 2011, 12:23 pm
by syth
Something like this should work:

Code: Select all

@echo off
set myFile=%1
set path="C:\Program Files\WinRAR\";%path%
set myDest=D:\
rar.exe a -esh -m0 %myDest%\%myFile%.rar %myFile%
The -m0 says to rar the file without an compression, which is appropriate for video or audio files. if your files are some other types that compress well, change that to -m5 for the best (slow) compression or remove it altogether for the default compression (equivalent of -m3)

Re: [Windows 2003] Simple script HELP

Posted: March 26th, 2011, 6:31 pm
by OfficerDoofy
Ive tried this and it rar whole mydest folder, can anyone help me with this script? Also is it posible to rar it in 402mb parts? Thanks in advance...

Re: [Windows 2003] Simple script HELP

Posted: July 15th, 2011, 4:59 am
by T4K
Can someone get this working? I tried the above method and it seems to rar the c:\program files\sabnzbd folder instead lol. That's not very handy. Greatly appreciated thanks in advance.

Re: [Windows 2003] Simple script HELP

Posted: July 15th, 2011, 5:28 am
by shypike
T4K wrote:Can someone get this working? I tried the above method and it seems to rar the c:\program files\sabnzbd folder instead lol. That's not very handy. Greatly appreciated thanks in advance.
This seems a safer bet:

Code: Select all

@echo off
set myDest=D:\folder
cd /d %1
set name=%2
set name=%name:"=%
"C:\Program Files\WinRAR\rar.exe" a -esh -m0 "%myDest%\%name%.rar" .

Re: [Windows 2003] Simple script HELP

Posted: July 17th, 2011, 1:01 am
by T4K
That actually worked quite nicely, good job. Do you know what needs to be added at the end of that to delete the stuff it just rared?

Re: [Windows 2003] Simple script HELP

Posted: July 17th, 2011, 2:57 am
by shypike
Append to the end of the script.

Code: Select all

cd ..
del /s/q %1
rd /s/q %1

Re: [Windows 2003] Simple script HELP

Posted: July 17th, 2011, 10:43 am
by T4K
Nicely done. Thanks.

Re: [Windows 2003] Simple script HELP

Posted: July 17th, 2011, 11:04 am
by T4K
shypike wrote:

Code: Select all

@echo off

set name=%name:"=%

Every once in awhile I end up with a =.rar file. If it take it out I end up with a blank.rar file.

Re: [Windows 2003] Simple script HELP

Posted: July 17th, 2011, 11:24 am
by shypike
Please explain, I have no idea what you mean.

Re: [Windows 2003] Simple script HELP

Posted: July 17th, 2011, 1:02 pm
by T4K
Image

It does that sometimes. Don't know why. Also I noticed it skips over FLAC/MP3 Files and doesn't add them to archives. Just deletes them :o

Re: [Windows 2003] Simple script HELP

Posted: July 17th, 2011, 2:01 pm
by shypike
The %2 parameter should be %3 (2=original NZB name, 3=bare-name-of-folder).
That could explain the empty name (well just maybe).
Are the music files in a sub-folder?
That would explain things, since the one who gave you the originals script left out the -r parameter.

The correct version should be:

Code: Select all

@echo off
set myDest=D:\folder
cd /d %1
set name=%3
set name=%name:"=%
"C:\Program Files\WinRAR\rar.exe" a -r -esh -m0 "%myDest%\%name%.rar" .
cd ..
del /s/q %1
rd /s/q %1

Re: [Windows 2003] Simple script HELP

Posted: July 17th, 2011, 5:21 pm
by T4K
Example of the mp3/Flac issue.

http://pastebin.com/p4VYNdTR

Re: [Windows 2003] Simple script HELP

Posted: July 17th, 2011, 5:22 pm
by T4K
New one seems to be working aka the correct version. So I'll wait and see. Thanks for all the help skypike.