Page 1 of 1

RMDIR help

Posted: Thu Jul 18, 2002 2:13 pm
by Guest
???hello if I'm writing a qbasic program and I use RMDIR and I also need to use /s/q so it will delete not only the dir but also all the files that are inside the dir. How should I write? ;D

if i write Shell " rd d:\mik /s/q" it doesn't work
if i write Shell "rd d:\mik" it works only if there is nothing in dir. MIK.

please help me!!!!!!!!!

thanks a lot

Re: RMDIR help

Posted: Sun Jul 21, 2002 4:37 am
by pebe
Remove all the files in the directory first with:
 
 SHELL" DEL d:\mik\*.*"

Then you can remove the directory.

Re: RMDIR help

Posted: Tue Jul 30, 2002 12:11 pm
by madmartin55
That's basically a DOS limitation, Mike, so when you are trying to manipulate the dir structure (file search, add/remove dirs, etc.) you have to follow your DOS command structure. MS-DOS doesn't allow you to remove a dir with anything in it, so pebe's answer is right, but it might be different with a another OS. :)