Archive: Delete Documents and Settings\username


Delete Documents and Settings\username
Hello
First of all...sorry for my very bad english...

I have a pb with my uninstaller.
For my software, I need to create a new user named "demo".
So, I want to delete it when I uninstall my soft.
I manage to do that but I'd like to delete his personal folder (documents and settings\demo)too.
But when I do that (thanks rmdir /R), it give me an error and the folder is not erased...
How can I do this ?
Thank you.


The folder may probably still be in use. In that case, you need to use:

RmDir /r /rebootok

This will delete it on reboot.

-Stu


I've already try to do that but without success...

However, I can delete this folder manually, without pb.

Have somebody another idea ?

Thanks


Make sure that the folder you are trying to delete IS NOT the working directory. (You cannot delete the working directory.) Do this by using SetOutPath to set to a different working directory first.

Example:


SetOutPath "C:\foo"
RMDir /r "C:\Documents and Settings\demo"

Yes, I've done that but it's always the same...the demo folder isn't deleted...
Arg...
Somebody has another idea to help me...please ?

Thanks for those answers !


It isn't deleted after reboot either?

-Stu


No, it's not deleted even after reboot.
For the moment, I've found another solution, but it's a little "violent" :


nsExec::Exec 'cmd /C rmdir "c:\documents and settings\demo" /S /Q'


Have you another better idea ?
Thanks a lot for all your answers !