Jump to content
Sign in to follow this  
lyledg

Hotfix Temp folders not deleting

Recommended Posts

lyledg

I have a problem where temporary folders created by MS hotfix installations are not being deleted after an install, thus leaving a mess on the HD.

When I try to delete them, I get an access denied. This is because the ACL gets screwed at installation time and hence I need to restore the ACL using XCACLS

So, I need to do 3 things here

1) Find ALL folders as shown in the attached Pic. All these folders share the common structure of:

C:\<RANDOM File Name Created here>\sp2\update

2) Once they have been found, repermission the folder using XCACLS

3) Finally, delete the temp folder with all sub dirs

I have tried the following an get as far as finding the folder, but not sure about the rest..

Could someone help me please??

; Shows the filenames of all files in the current directory.

(Not sure how to do this part???)

$search = FileFindFirstFile("C:\*.*\SP2\Update")  

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    
    MsgBox(4096, "File:", $file)
WEnd

; Close the search handle
FileClose($search)

Share this post


Link to post
Share on other sites
lyledg

Hey there

Has anyone got any idea on this??

Cheers

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.