The vbs starts the defrag in it defualt cmd window, as to the wpi question I do not know about this as I do not use it. You can start the VBS from a cmd script. StartDefrag.cmd This does not need Start /Wait as it will only flash on the screen a quick cmd promt. I have add a delete the StartDefrag.cmd to the script.This needs the quotes ("PLACE_THE_LOCATION_OF_STARTDEFRAG.CMD_HERE") Re-Edit Save As Defrag.vbs Since I do not use WPI you could ask in the forums if you can run a VBS file directly from WPI, and if you can then use the first code.