I've done similar thing lately. But I use an external tool called DDFGenerator. It's free and small, and it handles long file name properly.
To compress structured folders and files with makecab.exe, a DDF file is a must. Instead of using the batch script mentioned in the answer you quoted, I used DDFGenerator for the same goal.
DDFGenerator on CodePlex
Say, the folder you want to "zip" locates at C:\MyFolder\MyData , use this command to generate a DDF file named "solution.ddf" at C:\MyFolder:
DDFGenerator "C:\MyFolder"
Note that DDFGenerator.exe iterate files "under" the folder you provides, so to compress C:\MyFolder\MyData, you should pass "C:\MyFolder" to it and make sure MyData is the only item in C:\MyFolder.
After the solution.ddf has been generated, a small tweak is necessary. Just open the "solution.ddf" with any text editor you prefer and make these changes:
Replace these 2 lines (at the very beginning):
.Set DiskDirectoryTemplate=CDROM
.Set CompressionType=MSZIP
To be:
.Set CabinetName1={YourCabName}.cab
.Set CompressionType=LZX
.Set CabinetFileCountThreshold=0
.Set FolderFileCountThreshold=0
.Set FolderSizeThreshold=0
.Set MaxCabinetSize=0
.Set MaxDiskFileCount=0
.Set MaxDiskSize=0
(Replace {YourCabName} to whatever suit your needs)
These changes ensure no splitting and with better compression ratio.
Then, run the makecab command at C:\MyFolder to build the cab:
makecab.exe /F solution.ddf
The {YourCabName}.cab will be located under C:\MyFolder\disk1 after done. Just take it and delete other files that have been generated.
To "unzip" the cab at current path, use command:
expand {YourCabName}.cab /F:* .