How can I check a directory to see whether it exists?<br>If exists, how can I delete all files & sub folders under that directory?.<br>Please help!!!!!!!!!!!!!!!!!!!!!!!!!!!!
To check , if you have already put a DirList , you can sent it : Dir1.Path="c:\YourPath" & if it doesn't exist it will generated an error<br><br><A HREF="mailto:dorne38@mageos.com">dorne38@mageos.com</A><br>
VB5.00 given't you a function for deleting all files in a directory.<br>You must delete all file in the directory with the instruction Kill "FileName" & only after you can delete the diretory with RmDir "Directory".<br>Remark : if you use RmDir without kill all files it occur an error<br><br>Remark ... Please sent me at <A HREF="mailto:drone38@mageos.com">drone38@mageos.com</A>
I use Dir(<i>DirectoryName</i>, vbDirectory). If the directory exists it returns a string. <p>Colin Chevrier<br><a href=mailto:colin.chevrier@ca.jdsunph.com>colin.chevrier@ca.jdsunph.com</a><br><a href= > </a><br>
NW,<br><br>If you really want to remove everything, you could invoke the DOS DELTREE command via the VB shell function. The catches are that:<br>under Win 95 / 98 you have to know the 8-character DOS name of the folder.<br>I'm not sure if this works at all in Win NT / 2000.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.