How to delete Dmol output files using script commands?

How to delete Dmol output files? I'm calculating energies for a lot of .xsd files and I would like to discard the files after energies calculations. When I use the command unlink \$file or \$doc->Delete nothing happens. These command just work in the debug mode.
I still can't use a generic command to find the current folder on windows. In linux is possible use "my \$folder="Perl%20Script_Files\\Documents". Is there any smilar command for windows?