Sign in to follow this  
Followers 0

File Delete funtion query

4 posts in this topic


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.


Dim $Path="\\abcd109\C$\Document and Settings\username\Local Settings\Temp"


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.



Share this post

Link to post
Share on other sites


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.

Share this post

Link to post
Share on other sites

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)

should work for tempdir you just have to change the filedest

have fun

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  
Followers 0