Array In Batch Script

G

Guest

I'm trying to create a batch script for backups using rar.exe. What I'm
wanting to do is create a separate .rar for each directory.

Here's an example...
c:\test\filename1.ext
c:\test\filename2.ext
c:\test\directory1\filename1.ext
c:\test\directory2\filename1.ext
c:\test\directory2\filename2.ext
c:\test\directory2\filename3.ext
I want to have c:\test\*.*, c:\test\directory1\*.*, and
c:\test\directory2\*.* in 3 separate .rar's.

I was thinking that I could do it with (e-mail address removed) (dir /B c:\test >
list.txt) but it doesn't make it create separate files. I'm thinking that I
need to do an array from list.txt or something, but I'm not sure how.
Honestly, I'm not sure if a batch file has the logic to even do arrays.
JJ
 
D

David H. Lipman

From: "doubleJ" <[email protected]>

| I'm trying to create a batch script for backups using rar.exe. What I'm
| wanting to do is create a separate .rar for each directory.
|
| Here's an example...
| c:\test\filename1.ext
| c:\test\filename2.ext
| c:\test\directory1\filename1.ext
| c:\test\directory2\filename1.ext
| c:\test\directory2\filename2.ext
| c:\test\directory2\filename3.ext
| I want to have c:\test\*.*, c:\test\directory1\*.*, and
| c:\test\directory2\*.* in 3 separate .rar's.
|
| I was thinking that I could do it with (e-mail address removed) (dir /B c:\test >
| list.txt) but it doesn't make it create separate files. I'm thinking that I
| need to do an array from list.txt or something, but I'm not sure how.
| Honestly, I'm not sure if a batch file has the logic to even do arrays.
| JJ

Please post in a Scripting News Groups such as...
microsoft.public.windows.server.scripting
The Command Interpreter is very limited and arrays are not availble as in the KiXtart
Scriptting Language ( http://kixtart.org KiXtart is CareWare )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top