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

Ok. I wonder how to take the list from the startdir and go for each element, what would you suggest put the list into an array and push through the array till it is empty?:
21.08.2009 11:03 <DIR> Administrator 08.01.2010 13:38 <DIR> administrator.Domain 06.07.2009 08:27 <DIR> All Users 16.06.2009 13:08 <DIR> user 18.06.2009 13:08 <DIR> user2
Namely administrator, administrator.Domain, user and so on. So i would construct a new string?

$subdir = $startdir . $user . $Tempdir;
Where $startdir = "Dokumente/ und/ Einstellungen";
$user = @array[0]
$tempdir = "Lokale\ Einstellungen\TEMP";
Construct the path for user1 #e.g. "C:/Dokumente\ und\ Einstellungen/user/Lokale\ Einstellungen/Tem +p" delete recursive construct the path for user2 #e.g. "C:/Dokumente\ und\ Einstellungen/user/Lokale\ Einstellungen/Tem +p" construct the path for lastuser ...
My Problem is now putting the whole together ...
Any hints?
MH

Replies are listed 'Best First'.
Re^3: Win32: Deleting Temporary directories of all users on a machine (recursive)?
by cdarke (Prior) on Jan 15, 2010 at 13:41 UTC
    I am not certain what you are trying to achieve here. Looking at the recursive subroutine I supplied (zapfile), you could place additional name checks after:
    next if $name eq '.' or $name eq '..';
    For example:
    next unless $name =~ /Temp$/;