godspeedcapri Posted February 10, 2006 Share Posted February 10, 2006 Hi, I am newbie to AUTO IT and have written a script which deletes certain location(temporary folders,temp folder,history,recent) on a remote computer. The script works fine deleting most locations,except for TEMP folder. I am taking the computer name and user name as input and encoding the values into defined path variables. Eg: Dim $Path="\\abcd109\C$\Document and Settings\username\Local Settings\Temp" FileDelete($Path) I have also tried FileRecycle function. It is quite amazing that these functions work for Temporary Internet Files, Recent and History. I mean it deletes all files found in these folders, but does not delete any file or folder in Temp folder. Any help would be highly appreciated. Ta. GSP Link to comment Share on other sites More sharing options...
Nuffilein805 Posted February 10, 2006 Share Posted February 10, 2006 you can't delete the entire temp there are some files in use (recognized by a "~" in front of it i suggest you change your code so it leaves those files in the temp-dir my little chatmy little encryption toolmy little hidermy unsafe clickbot Link to comment Share on other sites More sharing options...
godspeedcapri Posted February 10, 2006 Author Share Posted February 10, 2006 Thanks. I am trying to delete the files in Temp folder, not the folder itself. Also I believe Temp folder stores some files & folders which belong to active programs(these cannot be deleted). It would be a daunting task to specify each and every file extension in Temp folder. Any easy way to do this? Suggestions for functions or keywords? The help file is not detailed with these functions. Link to comment Share on other sites More sharing options...
Nuffilein805 Posted February 10, 2006 Share Posted February 10, 2006 try this 1 $a = FileFindFirstFile ("*.*") while 1 $file = FileFindNextFile ($a) if @error then ExitLoop ;msgbox (0, "", $file) if stringleft ($file, 1) <> "~" and stringleft ($file, 1) <> "." and stringleft ($file, 1) <> ".." Then FileDelete ($file) Else EndIf WEnd should work for tempdir you just have to change the filedest have fun my little chatmy little encryption toolmy little hidermy unsafe clickbot 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