zac23 Posted February 13, 2009 Share Posted February 13, 2009 (edited) Hey im wrighting a script with a gui, ive got the gui to work but i cant figure out how to delete files from other perples user profiles without spesifying a user name to look at and not looking in the currrent user that is logged in, im sure im missing something simple any ideas? Edited February 13, 2009 by zac23 Link to comment Share on other sites More sharing options...
TheOnlyOne Posted February 13, 2009 Share Posted February 13, 2009 look at the Dirs just wright @ in index in the help file Link to comment Share on other sites More sharing options...
zac23 Posted February 13, 2009 Author Share Posted February 13, 2009 hey is there an example of this in help file? Link to comment Share on other sites More sharing options...
zac23 Posted February 13, 2009 Author Share Posted February 13, 2009 i got this so far but it dosent work need to do something with the "not' lol func deletetmpfiles() if FileExists("D:\userdata\*\Temp") not @UserName Then FileDelete("D:\userdata\*\Temp") Else MsgBox(1,"DelTemp","temp Dose not exist!") EndIf EndFunc Link to comment Share on other sites More sharing options...
herewasplato Posted February 13, 2009 Share Posted February 13, 2009 i got this so far but it dosent work need to do something with the "not' lolfunc deletetmpfiles()if FileExists("D:\userdata\*\Temp") not @UserName ThenFileDelete("D:\userdata\*\Temp")ElseMsgBox(1,"DelTemp","temp Dose not exist!")EndIfEndFuncPlease consider working thru this tutorial on using AutoIthttp://www.autoitscript.com/forum/index.ph...st&p=607559Also, it is not a good idea to delete every temp file - it might be best to only delete "old" ones. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
zac23 Posted February 13, 2009 Author Share Posted February 13, 2009 Also, it is not a good idea to delete every temp file - it might be best to only delete "old" ones. Link to comment Share on other sites More sharing options...
herewasplato Posted February 13, 2009 Share Posted February 13, 2009 But even a person that has logged off may have a temp file that is part of a document that can be recovered. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
zac23 Posted February 13, 2009 Author Share Posted February 13, 2009 But even a person that has logged off may have a temp file that is part of a document that can be recovered.there meant to save anything to a network drive that also keeps a record of deleted stuf for a whilewe go through and delete all of them anyway our operating system recreates anything important on logon tooim just trying to increase speed at which we speed up the pcs Link to comment Share on other sites More sharing options...
Spiff59 Posted February 13, 2009 Share Posted February 13, 2009 (edited) I'm not sure what OS you're using, but this (based upon the help file example for "_FileListToArray") might be a good way to start: #Include <File.au3> #Include <Array.au3> $FileList=_FileListToArray("C:\Documents and Settings\","*",2) If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _ArrayDisplay($FileList,"$FileList") For $x = 1 to $FileList[0] Switch $FileList[$x] Case "LocalService", "NetworkService", @UserName; users to ignore Case Else; users to process MsgBox(1,"","Deleting temp files for: " & $FileList[$x]) EndSwitch Next That example is tuned for my Windows XP Pro SP3... Edit: added @UserName to switch statement Edited February 13, 2009 by Spiff59 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now