Create a batch file that will zip two files with the same name (but different extensions) -
Create a batch file that will zip two files with the same name (but different extensions) -
i'm new programming , started working @ info archive facility. big part of job zipping pdf , autocad files (.dwg) together. manager has me doing hand , there thousands of files zip, looking more efficient way.
at moment, have folder contains 500 files, 250 of them pdfs , 250 of them drawings. each pdf has matching drawing same name , want zip them in pairs. (the zip file should have same name.)
the naming convention this: 1.pdf 1.dwg 2.pdf 2.dwg ...etc.
i want create this: 1.zip (containing 1.pdf , 1.dwg) 2.zip (containing 2.pdf , 2.dwg)
i have done research , understand many people have written similar programs using batch files. however, find myself stuck. not have permission download 7zip or doesn't come windows 7.
i tried this:
@echo off path=k:\fod-fdc\tsg\holding\rotate\osu-090344\vol_4_complete %f in (*.dwg) 7z "%~nf.zip" "%~nf.dwg" "%~nf.pdf" obviously it's not right lot of reasons (most notably don't have 7-zip) still trying find solution.
can help me out? give thanks much in advance!
you have double % in .batfile :
try this
@echo off set $path="k:\fod-fdc\tsg\holding\rotate\osu-090344\vol_4_complete\" pushd %$path% %%f in (*.dwg) 7z "%%~nf.zip" "%%~nf.dwg" "%%~nf.pdf" popd echo done !!! batch-file zip
Comments
Post a Comment