in reply to Re^2: Win32: Deleting Temporary directories of all users on a machine (recursive)?
in thread Win32: Deleting Temporary directories of all users on a machine (recursive)?

If you wanna module, then... rmtree() in File::Path seems to work pretty well.
#!/usr/bin/perl -w use strict; use Data::Dumper; use File::Path; my $Dir2Delete = 'C:/temp/JUNK'; rmtree( $Dir2Delete, { verbose => 1, error => \my $err_list } ); print Dumper $err_list; #should be $VAR1 = [];, ie null
  • Comment on Re^3: Win32: Deleting Temporary directories of all users on a machine (recursive)?
  • Download Code