No the example I've seen uses vbscript to invoke the dfrgntfs.dll [via COM], then invokes the defrag method on the com object.

While either approach is valid, I think I prefer the COM approach as it allows other people to embed it into their code e.g. via a VB program.

I'll see if I can dig up the script [its on one of the PCs at work that one of our employees uses].