Archive: RMDir /REBOOTOK setting reboot flag unnecessarily?


RMDir /REBOOTOK setting reboot flag unnecessarily?
So, I have the following code

Delete "$R2\something"
ClearErrors
RMDir /REBOOT "$R2"


where $R2 is a folder path (generally, it's $INITDIR, but this is in a function, and it's passed as a parameter).

I've placed MessageBox calls around the steps here, and checks for ${If} {$RebootFlag}. The reboot flag is clear up to the point where RMDir is executed, and it gets set afterward.

The problem is, I'm also watching this folder, and the thing is empty at the time RMDIr gets called. There are no files in it at all. There's no reason I can think of why RMDIr would not be able to delete the folder, and so would cause the reboot flag to get set.

Am I missing something? Is there some odd behaviour on the part of RMDir that could cause this?

Sure you aren't trying to delete the working directory? Try SetOutPath $TEMP first.

Stu


This is during .onInit(). Is SetOutPath valid?

In any case, I tried that, and it didn't work.


Never mind; I was being an idiot and trying to delete the wrong directory.