kingooo Posted July 16, 2011 Share Posted July 16, 2011 hi really i try many time to delete files that exists in temp folder in win 7 but i can not can any one to help me and give me codes to delete this files there is not any problems with xp but in win 7 cann't delete them Link to comment Share on other sites More sharing options...
Andreik Posted July 16, 2011 Share Posted July 16, 2011 Maybe the files that are not deleted are locked or in use. Did you checked that? When the words fail... music speaks. Link to comment Share on other sites More sharing options...
kingooo Posted July 16, 2011 Author Share Posted July 16, 2011 Maybe the files that are not deleted are locked or in use. Did you checked that?if you have win 7, you can try for deleting files in temp folder by scripts believe me you can not delete them by autoit but you can delete them manuallyi can delete files in temp folder manually but i can not delte them by autoit script Link to comment Share on other sites More sharing options...
Andreik Posted July 16, 2011 Share Posted July 16, 2011 In this case maybe your script is wrong. Show us the script to see it. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Exit Posted July 16, 2011 Share Posted July 16, 2011 (edited) So show us your autoit code. Edit: Andreik was quicker. Edited July 16, 2011 by forumer100 App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
kingooo Posted July 16, 2011 Author Share Posted July 16, 2011 So show us your autoit code. Edit: Andreik was quicker. filedelete(@tempdir&"\*.*") FileDelete( @HomeDrive&"\temp\*.*") FileDelete( @WindowsDir &"\temp\*.*") Link to comment Share on other sites More sharing options...
Developers Jos Posted July 16, 2011 Developers Share Posted July 16, 2011 This is likely because a file in this directory is still in use and the command stops. Try is with a single file and tell us if that works. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
kingooo Posted July 16, 2011 Author Share Posted July 16, 2011 This is likely because a file in this directory is still in use and the command stops.Try is with a single file and tell us if that works.Josjos jos hahahahahow are youreally i miss you hahahahaok i want make tool to clean pc --- pls give me solve for this problem Link to comment Share on other sites More sharing options...
Developers Jos Posted July 16, 2011 Developers Share Posted July 16, 2011 jos jos hahahahahow are youreally i miss you hahahaha Don;t think I was trying to be funny and guess you did not really miss me.ok i want make tool to clean pc --- pls give me solve for this problemHave you read my answer and if so: what was the result?Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GEOSoft Posted July 16, 2011 Share Posted July 16, 2011 (edited) Get the files into an array first then loop through the array and it will work just fine. $iDeleted = 0 For $i = 1 To Ubound($aFiles) -1 If NOT FileDelete($aFiles[$i]) Then $iDelete += 1 Next Using wildcards is no good when there is a chance the delete will fail for any reason and in this case the others are probably correct in saying you have a file in use at the time you are running the script. Something else you want to look at in the temp folder is the fact you can not FileDelete a Folder. For that you have to use DirRemove() For $i = 1 To Ubound($aFiles) -1 If StringInStr(FileGetAttrib($aFiles[$i]), "D") Then DirRemove($aFiles[$i]) ContinueLoop EndIf FileDelete($aFiles[$i]) Next Edited July 16, 2011 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
kingooo Posted July 16, 2011 Author Share Posted July 16, 2011 that is no solve for any problem ccleaner always delete them i can delete them manually you must think to best in autoit script run your mind to find some solve for this problem Link to comment Share on other sites More sharing options...
Developers Jos Posted July 16, 2011 Developers Share Posted July 16, 2011 that is no solve for any problemccleaner always delete themi can delete them manuallyyou must think to best in autoit scriptrun your mind to find some solve for this problemAgain, and this time answer me because else you will get the same treatment as the last time only this time a little longer.Have you tested what I asked you to do? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
GEOSoft Posted July 16, 2011 Share Posted July 16, 2011 I'm sorry but that does solve the problem. I have my own cleaner which includes the temp folder and the only files ever left behind are those that are in use. That cleaner uses code similar to what I gave you with the exception that I have some error checking in it. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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