Answer by cowlinator for Can you zip a file from the command prompt using...
There is a single, simple cmd.exe command for this (through PowerShell v5.0+).To zip:powershell Compress-Archive -LiteralPath 'C:\mypath\testfile.txt' -DestinationPath "C:\mypath\Test.zip"To...
View ArticleAnswer by venimus for Can you zip a file from the command prompt using ONLY...
Windows 10 build 17063 or later is bundled with tar.exe which is capable of working with ZIP files from the command line.tar.exe -xf archive.zipOr to create a ZIP archive:tar.exe -a -cf Test.zip Test
View ArticleAnswer by kayleeFrye_onDeck for Can you zip a file from the command prompt...
This is a mutation of the accepted answer. I do a ton of automation tasks on up to thousands of files at a time, so I can't just sleep for 2 seconds and not care about it. I gleaned the workaround...
View ArticleAnswer by Hashbrown for Can you zip a file from the command prompt using ONLY...
If on Windows 8 or Windows Server 2012 you'll have PowerShell and .NET 4.5, so you can do this:zip.ps1 (usage: -directory <directory to zip up> -name <zip name>):param ( [string]$directory,...
View ArticleAnswer by npocmaka for Can you zip a file from the command prompt using ONLY...
Here's my attempt to summarize built-in capabilities in Windows for compression and uncompression - How can I compress (/ zip ) and uncompress (/ unzip ) files and folders with batch file without using...
View ArticleAnswer by user228211 for Can you zip a file from the command prompt using...
The Windows command line now provides the COMPACT command which, as far as I can tell, is native to Windows. That should meet the requirements requested unless I missed something.
View ArticleAnswer by Olc for Can you zip a file from the command prompt using ONLY...
Multiple files / directories with simplified code.cscript zip.vbs target.zip sourceFile1 sourceDir2 ... sourceObjNzip.vbs fileSet objArgs = WScript.ArgumentsZipFile = objArgs(0)' Create empty ZIP file...
View ArticleAnswer by Jiří Kočara for Can you zip a file from the command prompt using...
'Keep script waiting until compression is doneDo Until objShell.NameSpace( ZipFile ).Items.Count = objShell.NameSpace( InputFolder ).Items.Count WScript.Sleep 200Loop
View ArticleAnswer by George Yockey for Can you zip a file from the command prompt using...
You can eliminate the risk of timing out during compression by polling for existence of the compression dialog window. This method also handles the user cancelling out of the compression...
View ArticleAnswer by Peter Mortensen for Can you zip a file from the command prompt...
Here is an all batch file solution (a variation of my other answer) that will zip a file named c:\ue_english.txt and put it in C:\someArchive.zip:set FILETOZIP=c:\ue_english.txtset...
View ArticleAnswer by Peter Mortensen for Can you zip a file from the command prompt...
It is possible to zip files without installation of any additional software (I have tested it). The solution is:Run this in a command-line window to create a ZIP filenamed C:\someArchive.zip containing...
View ArticleAnswer by Beaner for Can you zip a file from the command prompt using ONLY...
If you are open to using PowerShell, zip capabilities are available in .NET 2.0 (PowerShell is .NET). Here's an a example (source) credit to Mike...
View ArticleAnswer by cowgod for Can you zip a file from the command prompt using ONLY...
If you are able to install the Resource Kit Tools, you will find a command line tool called COMPRESS that can create compressed archive files like zip.Microsoft (R) File Compression Utility Version...
View ArticleCan you zip a file from the command prompt using ONLY Windows' built-in...
I have a batch file that outputs a text file. I thought it would be nice if I could zip it up too.This will be used in an uncontrolled environment, so I can't make assumptions about the presence of...
View Article