Automated deletion of folder stopped working

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
A Keymaker
Posts: 455
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Automated deletion of folder stopped working

Post by A Keymaker » 14 Mar 2024, 04:56

When I was testing this

Code: Select all

Loop
{
    IfExist, C:\Users\YOUR-USER-NAME\Documents\Kutools for Excel"    {
        FileRemoveDir, C:\Users\YOUR-USER-NAME\Documents\Kutools for Excel,, 1
    }
    Sleep, 1111
}
it was working A-OK; i.e. whenever

C:\Users\YOUR-USER-NAME\Documents\Kutools for Excel

folder was automatically created by Kutools it also got deleted a moment later. But now this script for whatever reason ignores that fact of that folder existence, despite AHK being run with privileges and despite me performing Take Ownership on that folder


How could it be? I changed nothing and all updates I have on hold



I am using Kutools For Excel 26.10 on Windows 10 Enterprise 20H2 x64

just me
Posts: 9550
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Automated deletion of folder stopped working

Post by just me » 14 Mar 2024, 05:00

IfExist, C:\Users\YOUR-USER-NAME\Documents\Kutools for Excel"
?

gregster
Posts: 9096
Joined: 30 Sep 2013, 06:48

Re: Automated deletion of folder stopped working

Post by gregster » 14 Mar 2024, 05:11

Also, I doubt that you can use OTB style for blocks with IfExist.

User avatar
mikeyww
Posts: 27241
Joined: 09 Sep 2014, 18:38

Re: Automated deletion of folder stopped working

Post by mikeyww » 14 Mar 2024, 06:32

:arrow: FileRemoveDir has two parameters.

User avatar
A Keymaker
Posts: 455
Joined: 31 May 2022, 13:46
Location: Donjon du Château de Mérovingien

Re: Automated deletion of folder stopped working

Post by A Keymaker » 06 Apr 2024, 04:29

I really do not know what I was thinking, as this can be as simple as

Code: Select all

Loop
{
    FileRemoveDir, C:\Users\YOUR-USER-NAME\Documents\Kutools for Excel, 1
    Sleep, 1111
}
and it does seem to work A-OK - but only in a standalone file

Because if I put this above snippet in my bulk AHK that holds various other needed by me daily usage adjustments, then this part of that bulk AHK

Code: Select all

#SingleInstance Force
SetTimer, Update_This_Script, 333
Return

Update_This_Script:
    FileGetAttrib, attribs, %A_ScriptFullPath%

    IfInString, attribs, A
        {
        FileSetAttrib, -A, %A_ScriptFullPath%
        SplashTextOn, 200, 200, ● ● ● ● ● ● ● ● ● ● ● ●,`n S C R I P T`n`n U P D A T E D `n`n ● ● ● ● ● ● ● ● ●
        WinSet, AlwaysOnTop, Off, ● ● ● ● ● ● ● ● ● ● ● ●
        SetTimer, Remove_Pop_Up_Window, 1111
        SetTimer, Reload_This_Whole_File, 2222
        }
Return

Remove_Pop_Up_Window:
    SplashTextOff
    SetTimer, Remove_Pop_Up_Window, Off
Return

Reload_This_Whole_File:
    Reload
Return
being above this Kutols snippet apparently makes code for deletion inactive


Post Reply

Return to “Ask for Help (v1)”