[Windows 2003] Simple script HELP

Come up with a useful post-processing script? Share it here!
Post Reply
User avatar
OfficerDoofy
Newbie
Newbie
Posts: 9
Joined: January 18th, 2011, 5:26 am

[Windows 2003] Simple script HELP

Post 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...
Gail Swallows!
User avatar
syth
Jr. Member
Jr. Member
Posts: 60
Joined: August 1st, 2008, 2:54 am
Location: Zed Zed 9 Plural Zed Alpha

Re: [Windows 2003] Simple script HELP

Post 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)
User avatar
OfficerDoofy
Newbie
Newbie
Posts: 9
Joined: January 18th, 2011, 5:26 am

Re: [Windows 2003] Simple script HELP

Post 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...
Gail Swallows!
T4K
Newbie
Newbie
Posts: 7
Joined: July 6th, 2011, 9:33 pm

Re: [Windows 2003] Simple script HELP

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: [Windows 2003] Simple script HELP

Post 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" .
T4K
Newbie
Newbie
Posts: 7
Joined: July 6th, 2011, 9:33 pm

Re: [Windows 2003] Simple script HELP

Post 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?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: [Windows 2003] Simple script HELP

Post by shypike »

Append to the end of the script.

Code: Select all

cd ..
del /s/q %1
rd /s/q %1
T4K
Newbie
Newbie
Posts: 7
Joined: July 6th, 2011, 9:33 pm

Re: [Windows 2003] Simple script HELP

Post by T4K »

Nicely done. Thanks.
T4K
Newbie
Newbie
Posts: 7
Joined: July 6th, 2011, 9:33 pm

Re: [Windows 2003] Simple script HELP

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: [Windows 2003] Simple script HELP

Post by shypike »

Please explain, I have no idea what you mean.
T4K
Newbie
Newbie
Posts: 7
Joined: July 6th, 2011, 9:33 pm

Re: [Windows 2003] Simple script HELP

Post 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
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: [Windows 2003] Simple script HELP

Post 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
T4K
Newbie
Newbie
Posts: 7
Joined: July 6th, 2011, 9:33 pm

Re: [Windows 2003] Simple script HELP

Post by T4K »

Example of the mp3/Flac issue.

http://pastebin.com/p4VYNdTR
T4K
Newbie
Newbie
Posts: 7
Joined: July 6th, 2011, 9:33 pm

Re: [Windows 2003] Simple script HELP

Post by T4K »

New one seems to be working aka the correct version. So I'll wait and see. Thanks for all the help skypike.
Post Reply