Kudos Posted May 7, 2006 Share Posted May 7, 2006 hi there!i've something like hundreds of files to makecab, is there a faster way than using cmd command? Link to comment Share on other sites More sharing options...
Delprat Posted May 7, 2006 Share Posted May 7, 2006 put all your files in a single folderat the cmd prompt, use CD command to go in that folderuse this to compress all files :FOR %i IN (*) DO MAKECAB /D CompressionMemory=21 %i(the part in italic enables the max compression level)you'll get all the compressed files mixed up with the originals, to move the cabbed ones to a folder, use the MOVE command :MOVE *.??_ X:\Path\to\Cabbed\files\*.*++ Link to comment Share on other sites More sharing options...
Yzöwl Posted May 7, 2006 Share Posted May 7, 2006 (edited) You don't need to move them later, if you build in a delete command!Copy all the files, if you want them keeping in an uncompressed form, to a folder, then drag and frop the folder onto this file.cabem.cmd@PUSHD %1 ||EXIT@FOR /F "DELIMS=" %%? IN ('DIR/B/A-D') DO (@MAKECAB "%%?">NUL 2>&1 &&@DEL /A/F "%%?")It should be on two lines only!<Edit>If you want the safety of not deleting and not copying first, here's a safer version. It will create a folder inside the one you dropped named cabbed, and place all your newly cabbed files inside it, leaving the originals alonecabit.cmd@PUSHD %1 ||EXIT@FOR /F "DELIMS=" %%? IN ('DIR/B/A-D') DO (@MAKECAB "%%?" /L "CABBED">NUL 2>&1)This one is two lines too!</Edit> Edited May 7, 2006 by Yzöwl Link to comment Share on other sites More sharing options...
Delprat Posted May 8, 2006 Share Posted May 8, 2006 (edited) You don't need to move them later, if you build in a delete command!Of course, but i'm lazier than you May i ask you what is the difference between :FOR %i IN (*) DO something with the file %i-and-FOR /F "DELIMS=" %%? IN ('DIR/B/A-D') DO something with the file %%?hidden files maybe ?++edit: thanks Yzöwl Edited May 9, 2006 by Delprat Link to comment Share on other sites More sharing options...
Yzöwl Posted May 8, 2006 Share Posted May 8, 2006 It just picks up more files, for instance any which contain additional dots in the filename. It also has the added benefit of being quicker to edit using findstr in regular expressions for instance. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now