Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    16

    Huh? ID Users and Clean Temporary Internet Files

    I'm trying to add the function to identify all users on a Windows XP system and then add those variables to a file.delete actions.

    [Example Actions]
    File.Delete("C:\Documents and Settings\USER1\Local Settings\Temp", true, false, true, nil);

    File.Delete("C:\Documents and Settings\USER1\Local Settings\Temporary Internet Files", true, false, true, nil);

    File.Delete("C:\Documents and Settings\USER2\Local Settings\Temp", true, false, true, nil);

    File.Delete("C:\Documents and Settings\USER2\Local Settings\Temporary Internet Files", true, false, true, nil);

    This is a cleanup tool, the problem is the "USER1" and "USER2" are unknown variables on each system. I know how to get the users into a table with this.

    USERS = Registry.GetValueNames(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Exp lorer\\DocFolderPaths");

    How do I insert the user name into each File.Delete action? I've made attempts with various text outputs and String.Concat but keep running into walls no matter which way I work it.

    Anyone have an ideal for a way to have [on clink] clean out Temp & Temporary Internet Files for all users on an XP system when the names are an unknown variable?

    Much appreciate an insight or script.
    Thanks

  2. #2
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Code:
    tblusers = {"You", "Me", "MeToo"};
    for index, user in tblusers do
    File.Delete("C:\\Documents and Settings\\"..user.."\\Local Settings\\Temp", true, false, true, nil); 
    
    File.Delete("C:\\Documents and Settings\\"..user.."\\Local Settings\\Temporary Internet Files", true, false, true, nil); 
    end
    obviously you would want to get the users from the registry but that is one suggestion on how you might do it.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  3. #3
    Join Date
    Dec 2003
    Posts
    16

    Lightbulb That gives me ideals at least :)

    Thanks, I've good something to try now, I was'nt famiular with "for index, user in tblusers do". I'll have to search for those and do some reading.

    I'll give it a try tonight.

  4. #4
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Quote Originally Posted by Mythwyn
    Thanks, I've good something to try now, I was'nt famiular with "for index, user in tblusers do". I'll have to search for those and do some reading.

    I'll give it a try tonight.
    It is in the help guide. Look for enumerating tables using a for loop.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts