DarkLord23
10th January 2002 11:04 UTC
Remove recusrively
Hi all,
I've a very short question for u. Could you please tell me how to delete files in subdiretories. I have something like,
\dir1\dir2\files ...
\dir1\dir3\files ...
\dir1\dir4\files ...
If i try Delete /r $INSDIR\dir1
Will it work (and remove files in dir1 also?)
Thanks and regards
SQwerl
10th January 2002 11:17 UTC
No, Delete does not remove Directories. You would need to do something like this
# use *.* to delete all files in one dir,
# or you could delete each file
# individually, but why?
Delete "$INSTDIR\myAPP\*.*"
# This will delete all dir's, that are in
# the install dir.
RMDir /r "$INSTDIR"
btw, I am not sure if the enclosing Quotes are needed around $INSTDIR, if anyone knows for sure, i'd appreciate some feedback. I would think they are needed, if the Dir contains spaces, such as c:\program files\myAPP
DarkLord23
10th January 2002 13:10 UTC
Originally posted by SQwerl
[B]No, Delete does not remove Directories. You would need to do something like this
Delete "$INSTDIR\myAPP\*.*"
# This will delete all dir's, that are in
# the install dir.
When using this
DELETE "$INSTDIR\conf\*.*"
this will deletre all files in that directory but not the subdirectories !!!!
Hence If I have a directory called $INSTDIR\conf\xml\
Xml directory is not deleted and the files in this directory neither !!
So my questions is how to Clear a directory and its sub-direcotries (There are too much directories to clear them by hand)
File /r works for copy ....
F. Heidenreich
10th January 2002 14:51 UTC
Like SQwerl mentioned above: use
RMDir /r $INSTDIR\dir1
to delete dir1 and all its subdirectories.
Hope this helps -
Regards,
~ Florian
DarkLord23
10th January 2002 14:55 UTC
Originally posted by F. Heidenreich
Like SQwerl mentioned above: use
RMDir /r $INSTDIR\dir1
to delete dir1 and all its subdirectories.
Hope this helps -
Regards,
~ Florian
Thanks ;)
SQwerl
10th January 2002 18:07 UTC
ahh, after rereading my original post, i see that i was a little confusing. sorry about that. :)
DarkLord23
11th January 2002 08:23 UTC
no problem