I'm trying to emulate the Windows
Send to/Compressed (zipped) folder function using the Microsoft tool
compress.exe, included as part of the Windows Server 2003 Resource Kit.
It might not be possible with that tool, but I'm having trouble getting it to produce anything. I have tried this scenario:
md test cd test md folder echo this is file 1 >folder\file1.txt echo this is file 2 >folder\file2.txt md output compress folder\*.* output -z Microsoft (R) File Compression Utility Version Copyright (C) Microsoft Corp. 1990-1999. All rights reserved. Compressing folder\file1.txt to output\folder\file1.txt using MS-ZIP compression. Compressing folder\file2.txt to output\folder\file2.txt using MS-ZIP compression. dir /s Volume in drive C is TI80140500H Volume Serial Number is AC18-E911 Directory of C:\test 12/05/2015 01:22 a.m. <DIR> . 12/05/2015 01:22 a.m. <DIR> .. 12/05/2015 01:34 a.m. <DIR> folder 12/05/2015 01:22 a.m. <DIR> output 0 File(s) 0 bytes Directory of C:\test\folder 12/05/2015 01:34 a.m. <DIR> . 12/05/2015 01:34 a.m. <DIR> .. 12/05/2015 01:35 a.m. 15 file1.txt 12/05/2015 01:36 a.m. 17 file2.txt 2 File(s) 32 bytes Directory of C:\test\output 12/05/2015 01:22 a.m. <DIR> . 12/05/2015 01:22 a.m. <DIR> .. 0 File(s) 0 bytes Total Files Listed: 2 File(s) 32 bytes 8 Dir(s) 558,695,092,224 bytes free
I can't see any files produced by this seemingly successful sequence. How to you coax
compress to produce a zipped folder - or anything at all?
** UPDATE **
Here's the help for the tool:
Syntax: COMPRESS [-R] [-D] [-S] [ -Z | -ZX ] Source Destination COMPRESS -R [-D] [-S] [ -Z | -ZX ] Source [Destination] Description: Compresses one or more files. Parameter List: -R Rename compressed files. -D Update compressed files only if out of date. -S Suppress copyright information. -ZX LZX compression. This is default compression. -Z MS-ZIP compression. Source Source file specification. Wildcards may be used. Destination Destination file | path specification. Destination may be a directory. If Source is multiple files and -r is not specified, Destination must be a directory. Examples: COMPRESS temp.txt compressed.txt COMPRESS -R *.* COMPRESS -R *.exe *.dll compressed_dir
The first of the three examples looks like it takes a file and produces a compressed version of that file. Which it does.
The second does what you would expect, producing
COMPRESS -R *.exe *.dll compressed_dir does actually do something, making a lie of my previous assertions. It produces a file compressed_dir._ which I guess holds the files.
COMPRESS -R *.txt *.vbs folder compressed_dir on the other hand ignores the folder AFAICT.
COMPRESS -R folder compressed_dir gives an error
"ERROR: The compressed_dir file is not found.".
So my conclusion is that it can't compress folders, and that it can't produce ZIP files/compressed folders.
Whatever, I have given up and used 7Zip, which works a treat.