Batch Script Help Needed (.BAT)

Show off new creations, get help, or just chat about all aspects of web development and design.

Batch Script Help Needed (.BAT)

Postby jenkins_08 on Fri Sep 26, 2008 12:02 pm

EDIT: Work-around found. Still would like the solution to the problem below but found removing the Include list completely was a better option.

Hi all.

Last few days i've been writing some Useful software for Source and other Source related utilities. :-)

So far all is very well apart from one medium sized problem, Archiving.

I'm using WinRAR with Advanced Command Line options and i need to know how to "preserve" the Folder Structure of what i'm Archiving....

Here is the RAR part of the script...

Code: Select all
PUSHD %1
"%RARDIR%" a -m5 -r -t "vmpta_tmp.rar" @"%DIR%\include.txt" -x\DownloadLists -x\maps\soundcache\*.cache -x\SAVE -x\screenshots -x\reslists -x\materials\maps -x\materials\temp -x"%DIR%\include.txt" -x@"%DIR%\exclude.txt"
POPD


Now all of that works fine, only problem is inside the Outputted RAR Archive i get a folder structure like

Code: Select all
vmpta_tmp.rar ==
Program |+
             | Files
                       | Steam
                                   | Steamapps
                                                      | SourceMods
                                                                         | ModName
                                                                                          | RAR Was created here.


But i need...
Code: Select all
vmpta_tmp.rar ==
ModName |+
               | RAR Was created here.


Here is an example from Include list:
Code: Select all
C:\Program Files\Steam\steamapps\SourceMods\mod\gameinfo.txt
C:\Program Files\Steam\steamapps\SourceMods\mod\readme.txt

And an example from Exclude list:
Code: Select all
C:\Program Files\Steam\steamapps\SourceMods\mod\demoheader.tmp



I've just spent about 4 hours trying to make some kind of hack to stop WinRAR from keeping the folder structure from the root Drive.

Please this is all i need to fix the last bug, i've googled my ass off the last 6 hours trying to find what switch winRAR needs to Preserve Folder structure from where the archive was created... :(

I know my code could be a bit cleaner but for now it works, i just need this Folder Structure sorted then i can release the software :?

Any help would be much appreciated

Cheers, Jenkins

WinRAR Command Line Help: C:\Program Files\WinRAR\winrar.chm
User avatar
jenkins_08
1337 p0st3r
1337 p0st3r
 
Joined: Thu Sep 11, 2008 12:07 am
Location: NSW Australia

Return to Web Design & Development

Who is online

Users browsing this forum: No registered users