A solution using JavaScript

Java Tutorial: Working with Files and Directories in Java:—Contents