New
#1
Creating Batch File to Recompress MS Cabinet Files
I'm trying to write a batch file that will scan/search a directory for MS Cabinet files. Then extract the contents of each cabinet file. The extracted contents are then "stored" in a cabinet file with the same file name as the original file. The new file then overwrites the old file.
Presently, the setup is -
search for cabinet files;
extract cabinet content to temporary directory;
"store" the extracted content as a cabinet file, and the cabinet file named the same as the original cabinet file;
copy the new cabinet file to original file location and overwrite the old file;
delete contents of temporary directory for receiving extracted contents of any other cabinet files;
repeat process until all cabinet files changed.
I've written a batch file as below, but on running it, it only processes some cabinet files, and get a message that file not found for other non-processed cabinet files?
The directory being tested on has approximately 150 cabinet files, but only 20 or so cabinet files are processed by the batch file!?
What is wrong with the batch file?
FOR %%A IN (*.cab) DO (cabarc x d:\sw_2014_rev\plastics\%%A C:\SW_TEMP\ | cabarc /m none n c:\sw_temp\%%A C:\SW_TEMP\*.* | XCOPY C:\SW_TEMP\%%A /v /y | DEL C:\SW_TEMP\*.* /q)