File compression using WINRAR command line utility on Windows Server 2003 machine
Posted on 2011-03-08
I have to write a batch file to use WinRAR cmd line utility which creates an archive in .zip format, which can be opened by any machine without WinRAR. I also need to copy the list of files archived to a .txt file, which will act as a log file for me to see whether the operation was successful or not. I was able to create a .rar file using rar.exe and was able to redirect the output to a .txt file using
"C:\Program Files\WinRAR\rar.exe" a -m5 -ed "c:\Supreeth\resources.rar" "C:\Projects\MyProject\resources" >"c:\Supreeth\log.txt"
However, the resources.rar requires only WinRAR to extract. All the files archived were added in log.txt.
"C:\Program Files\WinRAR\winrar.exe" a -afzip -m5 -ed "c:\Supreeth\resources.zip" "C:\Proje
The resources.zip file created can be opened by a machine which doesn't have winrar. But, I was not able to log all the files archived.
I want to create a .zip file and log the files archived as well. Please help