Optimize VMware Virtual Machine(s)

VWMware folders can get congested with log files, file fragmentation, and bloated file sizes. To remedy this, there is a utility available through VMware called VMware-mount-5.5.0-18463.exe. This utility will also work with version 6 of VMware (tested!). It offers among other things, several command line tools for handling VMware files. Along with a couple of handy scripts, that I have found.

clear.bat code

del /S /Q *.log
defrag d: -f -v
for /R %%i IN (*.vmdk) do call shrink_disk "%%i"
echo Klaar
pause

shink_disk.bat code

"C:\Program Files\VMware\VMware DiskMount Utility\vmware-mount" m: /d
"C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager" -d %1
"C:\Program Files\VMware\VMware DiskMount Utility\vmware-mount" m: %1
"C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager" -p M:
"C:\Program Files\VMware\VMware DiskMount Utility\vmware-mount" m: /d
"C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager" -k %1

The result is an optimized virtual machine.