I like compact WAL files. Actually I do:
archive_command = 'cp "%p"C:\\%f"'
What is the best way to do it?
Going by your other questions, it sounds like you have a short
archive_timeout so your WAL archives are mostly empty, but are still the full pre-allocated 16MB file.
On most platforms you just gzip them, e.g.
archive_command = 'gzip -c < "%p" > /archive/path/%f"'
On Windows this won't work natively due to the lack of the
gzip command. You'll need to install a compression utility that's usable from the command line, since the Windows zip support isn't directly usable from the commandline.
I suggest installing 7-zip, then using it in your
archive_command, with something like (untested):
archive_command = '%PROGRAMFILES%\7zip\7z.exe a "C:\\TheWALArchive\%f" "%p"'
Note that your
restore_command will need a corresponding decompression step.