Archive: A question regarding double quote


A question regarding double quote
If I have a folder called abc under $PROGRAMFILES, now I want to remove the folder abc. Should I call rmdir /r $PROGRAMFILES\abc or
rmdir /r "$PROGRAMFILES\abc" ?
What is the difference between them? Thanks.


If the name is actually abc then it should not matter, but if abc is really a define and this define has spaces, then you need to quote probably. Quotes don't hurt so there is no reason not to use them (They are not passed to windows, only makensis will see those quotes)

On the other hand, Exec '"foobar.exe" /baz' would pass the double quotes to windows (And this is what you want)


Note that it's very dangerous to use RmDir /r. Even if the directory is hardcoded like yours, the user may have stored files there that you don't know about, and that you shouldn't delete.


Originally posted by MSG
Note that it's very dangerous to use RmDir /r. Even if the directory is hardcoded like yours, the user may have stored files there that you don't know about, and that you shouldn't delete.
It depends on the requirement. If you want to keep some users' files, then the folder abc might not be removed. But if the folder abc must be removed anyhow, then I must remove it.

Originally posted by JohnChen
It depends on the requirement. If you want to keep some users' files, then the folder abc might not be removed. But if the folder abc must be removed anyhow, then I must remove it.
I meant that the user might (accidentally?) install or store stuff in your directory that doesn't belong to your software at all. You should only delete the files you know you want to delete.