Jump to content
Sign in to follow this  
reaper1gulf

autoit newb here

Recommended Posts

reaper1gulf

hey guys, i just started scripting and i'm trying to find a way to get the automation to navigate to the %userprofile%appdatalocaltemp and delete everything in it. I've got that part down, but the part i can't figure out is how to get it to close the temp folder. Here is a the code.
 

;function Close File In Use dialog box
Func CloseFIN()
   Send("{TAB}{SPACE}")
   Sleep(1000)
EndFunc
;open windows explorer, navigates to user's temp folder, deletes all and skips files in use
Send("#e")
Sleep(1000)
Send("!d")
Sleep(1000)
Send("%userprofile%AppDataLocalTemp{enter}")
Sleep(1000)
Send("^a")
Send("+{delete}")
Sleep(1000)
Send("!y")
Sleep(1000)
While 1
If WinExists("File In Use") Then
   CloseFIN()
   Else
EndIf
WEnd
 
 
Opt("WinTitleMatchMode",4)
$WinList=WinList("classname=ExploreWClass")
 
For $b=1 to $WinList[0][0]
    WinClose($WinList[$b][0])
Next 
 
 
Exit

Share this post


Link to post
Share on other sites
corgano

filedelete(@UserProfileDir&"appdatalocaltemp")

dircreate(@UserProfileDir&"appdatalocaltemp")

Google: Site:Autoitscript.com searchphraseshere


0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

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  

×