Cue Posted September 29, 2006 Share Posted September 29, 2006 (edited) I tried looking for something simalar but couldnt find it. heres my simple script which uses command line 7zip to archive multiple files and folders in a directory to individual archives. It currently does it in .zip format but this can be easily changed. the .zip files would be in the same directory as the uncompressed originals. This requires a copy of 7z.exe in the system32 windows folder and will only work for 32bit machines #include <Process.au3> #Include <File.au3> #Include <Array.au3> $folderpath = FileSelectFolder("Choose a folder.", "");choose a directory $FileList=_FileListToArray($folderpath); array of files in directory Dim $szDrive, $szDir, $szFName, $szExt, $i=1 ProgressOn("Multiple Zip", "0 percent", "Zipping") while $i<=$FileList[0]; do for all files in directory $Percent=Round((100/$FileList[0])*$i) $TsplitPath = _PathSplit($FileList[$i], $szDrive, $szDir, $szFName, $szExt);split filename and extension ProgressSet( $Percent, "Zipping:" & $FileList[$i],$Percent & " percent") RunWait("7z a -tzip "&"""" & $folderpath & "\(Zipped)\" & $szFName & ".zip"" """ & $folderpath & "\" & $FileList[$i] & """" , "", @SW_HIDE );run 7zip command line $i+=1;next file WEnd ProgressOff() MsgBox(0,"Multiple ZIp","Files Ziped to:"& @CRLF & $folderpath) Exit Edited September 29, 2006 by Cue Link to comment Share on other sites More sharing options...
Uten Posted September 29, 2006 Share Posted September 29, 2006 Try RunWait($cmd) Rather than _RunDos($cmd). Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Cue Posted September 29, 2006 Author Share Posted September 29, 2006 Thanks for the help. Just out of interest, do you know if _RunDos() waits for the proccess to complete anyway. because it took 12 seconds for the script to execute. 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