MSFN Forum: Compressing multiple files - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Compressing multiple files Rate Topic: -----

#1 User is offline   kipbi 

  • Group: Members
  • Posts: 2
  • Joined: 29-December 07

Posted 29 January 2008 - 09:49 AM

Hello,

I'm trying to compress 80 individual files to .ex_ .dl_ and .cr_ format.
I've tried searching the forum and then found this:

(not working for me)
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
SET SOURCE= <write the name of the source folder here>
SET TARGET= <write the name of the target folder here>
IF EXIST %SOURCE%\*.* FOR /F %%J IN ('DIR /A-D /OGN /B %SOURCE%\*.*') DO MAKECAB /D CompressionMemory=21 /D CompressionType=LZX /L %TARGET% %SOURCE%\%%J
(not working for me)

Compressing Drivers dll to dl_ How?

Unfortunatly it doesn't work for me. Nothing happens...
Does anyone know how to make it work or perhaps there's an other way? (And not one by one lol)
It's supposed to be separatly compressed, so that I have 80 separate compressed files with the extension .ex_ .dl_ and .cr_

I hope someone can help me :)


#2 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 8,792
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 29 January 2008 - 02:33 PM

That's (I mean compressing single files) exactly what the code snippet does.

As always when checking batch files, put temporarily some "PAUSE" statements and add some ECHO statements, try this:
 
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
SET SOURCE= <write the name of the source folder here>
SET TARGET= <write the name of the target folder here>
IF EXIST %SOURCE%\*.* FOR /F %%J IN ('DIR /A-D /OGN /B %SOURCE%\*.*') DO (
MAKECAB /D CompressionMemory=21 /D CompressionType=LZX /L %TARGET% %SOURCE%\%%J
ECHO Target is %Target%
ECHO Source is %Source%
ECHO File to be compressed is %%J
PAUSE
)
 


You did see these two lines:

Quote

SET SOURCE= <write the name of the source folder here>
SET TARGET= <write the name of the target folder here>

and put in them the right values, didn't you? :w00t:

DO NOT use PATHs with spaces in folder name.

jaclaz

This post has been edited by jaclaz: 29 January 2008 - 02:36 PM


#3 User is offline   kipbi 

  • Group: Members
  • Posts: 2
  • Joined: 29-December 07

Posted 29 January 2008 - 03:37 PM

Yeah! It works like a charm! :D

Thank u very much!


P.S. Yes I did see those two lines lol

#4 User is online   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 8,792
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 31 January 2008 - 07:23 AM

Happy everything went well. :)

jaclaz

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy