; ; Name: ZipDir2Zip.ahk ; Platform: Win9x/XP ; Author: Johny ; Date: Feb. 2006 ; ; Script Function: ; Save in a ZIP file all the "zip" sub-directories and their content. ; ; Init, Startup variables PathToScan=%A_ProgramFiles%\ ZipDest=c:\AppBackup.zip FileZipDirs=%A_WorkingDir%\Dir2Copy.txt FileZips=%A_WorkingDir%\File2Zip.txt WinZipPath=%A_ProgramFiles%\WinZip\WINZIP32.EXE ; << Be sure about this. ; Set Verbose to 1 to display status messages at each major execution steps Verbose=1 SplashImage, off ; Confirm about WinZip path. Quit if not exist IfNotExist, %WinZipPath% { MsgBox, WinZip not found in "%WinZipPath%". Please adjust the "WinZipPath" variable. ExitApp, 1 } ; Create a file containing all the 'zip' sub-directories we want to archive SplashImage, off If Verbose=1 SplashImage,,M,, Creating a file containing all 'ZIP' sub-directories - please wait, %A_ScriptName%,,, RunWait, %comspec% /c dir zip /ad /s /b > %FileZipDirs%, %PathToScan%, Min ; Loop, for all 'ZIP' sub-directories found, list their content FileDelete, %FileZips% If Verbose=1 SplashImage,,M,, List all 'ZIP' sub-directories content - please wait, %A_ScriptName%,,, Loop, Read, %FileZipDirs% { RunWait, %comspec% /c dir %A_LoopReadLine% /s /b >> %FileZips%, %PathToScan%, Min } ; Call WinZip to archive what have been found. If Verbose=1 SplashImage,,M,, Archive all 'ZIP' sub-directories content - please wait, %A_ScriptName%,,, RunWait, %WinZipPath% -min -a -r -p "%ZipDest%" @"%FileZips%", %PathToScan%, Min ; Conclusion SplashImage, off If Verbose=1 MsgBox, Archive operation completed in %ZipDest%