Jump to content
Sign in to follow this  
kingooo

autoit script is not usefull with this command

Recommended Posts

kingooo

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

Share this post


Link to post
Share on other sites
Andreik

Maybe the files that are not deleted are locked or in use. Did you checked that?


When the words fail... music speaks

Share this post


Link to post
Share on other sites
kingooo

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 manually

i can delete files in temp folder manually but i can not delte them by autoit script

Share this post


Link to post
Share on other sites
Andreik

In this case maybe your script is wrong. Show us the script to see it.


When the words fail... music speaks

Share this post


Link to post
Share on other sites
Exit

So show us your autoit code. ;)

Edit: Andreik was quicker. :)

Edited by forumer100

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites
kingooo

So show us your autoit code. ;)

Edit: Andreik was quicker. :)

filedelete(@tempdir&"\*.*")

FileDelete( @HomeDrive&"\temp\*.*")
FileDelete( @WindowsDir &"\temp\*.*")

Share this post


Link to post
Share on other sites
Jos

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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
kingooo

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

jos jos hahahaha

how are you

really i miss you hahahaha

ok i want make tool to clean pc --- pls give me solve for this problem

Share this post


Link to post
Share on other sites
Jos

jos jos hahahaha

how are you

really 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 problem

Have you read my answer and if so: what was the result?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
GEOSoft

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 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!"

Share this post


Link to post
Share on other sites
kingooo

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

Share this post


Link to post
Share on other sites
Jos

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

Again, 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?


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
GEOSoft

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!"

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.