So if I'm in a subfolder that I want to get rid of, I press the following button.
@set ChildPath={sourcepath$|noterm}
@runmode hide
Copy MOVE * TO ..
Go ..
@keydown:shift
@keydown:none
rmdir {$ChildPath}
The contents of the subfolder always MOVE one level up in the hierarchy.
And the GO command always works.
But when the computer is also busy doing something else, like copying another large file,
the RMDIR command is just ignored and the now-empty subfolder remains.
How to force the removal?
Are the commands behaving asynchronously, which would make a -f flag too dangerous?
No need to use the DOS rmdir these days. You can get the same thing using internal commands, removing the need to use MS-DOS Batch mode and @runmode hide.
@set ChildPath={sourcepath$|noterm}
Copy MOVE * TO ..
Go ..
@keydown:none
Delete {$ChildPath} FAILNOTEMPTY NORECYCLE
There might be something else still locking the directory. (Virus scanner, thumbnail generation, etc. are likely candidates, if nothing had been actively using it or launched while that folder was the current directory.)
I removed the QUIET flag so I would get the delete confirmation box,
I started a separate 5 gig file copying to my current drive just to slow things down,
Then I used the button on a folder full of files.
The move-to-parent happened (taking about 2 seconds of course)
but the delete confirmation never happened! - so delete is bailing out when there is a slow move, it seems,
I understand if it might be too dangerous to make the delete more forceful.
Try removing the FAILNOTEMPTY as well. (But don't actually delete the folder, just see if you're asked to confirm.) The folder may not be empty, causing the delete to be skipped.
Is a non-Windows NAS involved here or a local drive?
I recently switched the Function: type from MS-DOS to Standard Function (Opus or external). That may have fixed it!
edit: it did not fix. The Delete command still occasionally bails out FAILNOTEMPTY because it seems to be running before the copy MOVE above it is complete...
Not huge priority though. Don't even know if it is possible to fix...