Loop with hidden folder Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Ravenlord
Posts: 12
Joined: 19 Jan 2018, 03:43

Loop with hidden folder

12 Oct 2018, 02:58

This small script should find all folders with beggining 3 letters OLK and remove all of them.
This is only working if full path is copied in pattern place, all others with variables in path doesn't work.
If we choose any other folder for example on desktop and we create some OLK folders, then this gonna work as inteded with any form of pattern.
There can be something with \Temporary Internet Files\ which is hidden system folder and something doesn't really work with this.

Code: Select all

#NoEnv
#SingleInstance Force
;sciezka:= A_AppData "\Local\Microsoft\Windows\Temporary Internet Files\OLK*"
sciezka=%A_AppData%\Local\Microsoft\Windows\Temporary Internet Files\OLK*
msgbox, %sciezka%
;Loop, Files, C:\Users\rama51\AppData\Local\Microsoft\Windows\Temporary Internet Files\OLK*, D ;working
Loop, Files, %A_Appdata%\Local\Microsoft\Windows\Temporary Internet Files\OLK*, D
;Loop, Files, %Sciezka%,D
{
 	MsgBox, 4, , Filename = %A_LoopFileFullPath%`n`nContinue?
    IfMsgBox, Yes
      FileRemoveDir, %A_LoopFileFullPath%,1
    IfMsgBox, No
	        break
}
;return
User avatar
Ragnar
Posts: 204
Joined: 30 Sep 2013, 15:25

Re: Loop with hidden folder  Topic is solved

12 Oct 2018, 06:51

In Windows Vista or later, A_AppData contains the path "C:\Users\<UserName>\AppData\Roaming"

Instead, replace the Loop Files line with the following:

Code: Select all

EnvGet, A_LocalAppData, LocalAppData
Loop, Files, %A_LocalAppData%\Microsoft\Windows\Temporary Internet Files\OLK*, D
Ravenlord
Posts: 12
Joined: 19 Jan 2018, 03:43

Re: Loop with hidden folder

12 Oct 2018, 07:39

Thanks, didn't noticed it. Shame :)

Return to “Ask For Help”

Who is online

Users browsing this forum: DRocks, Hatsuko, parktaije, redorchestra and 26 guests