1

I need to zip content of a folder with the help of batch script. I need to complete this task without third party application.

Thanks in advance. Prakhar

Prakhar
  • 11
  • 1
  • [This might help](http://stackoverflow.com/a/27279354/1683264). – rojo Mar 05 '15 at 13:16
  • Without a third party you ill need to create your own compressing algorithm and it ill take a huge amount of time. Save yourself from this pain and use some kind of zip library/plugin – jean Mar 05 '15 at 13:21
  • I need to do it without any third application help. it is one of instruction for this work for me. – Prakhar Mar 05 '15 at 13:39
  • 1
    check this - http://stackoverflow.com/questions/28043589/how-can-i-compres-zip-and-uncopress-unzip-files-and-folders-with-batch-f – npocmaka Mar 05 '15 at 13:49
  • is there any way through which we can compress only files inside that folder , not the subfolders.. – Prakhar Mar 06 '15 at 13:09

1 Answers1

0

I know that it's probably what you don't want, but.. Maybe this will help:

"%homedrive%\Program Files\WinRAR\WinRAR.exe" a -ep1 NameThisFile.rar" "YourFolderToZip\*.*" >nul

This will zip all the files in the actual folder, so it won't zip the files from the subfolders.

Or it can look like this:

"WinRAR.exe" a -ep1 NameThisFile.rar" "YourFolderToZip\*.*" >nul

But that will work only if the executable(WinRAR.exe) is in the same folder as the batch file.

Tom Lenc
  • 765
  • 1
  • 17
  • 41