Deleting Folders in QB - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html) +--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html) +--- Thread: Deleting Folders in QB (/thread-3176.html) Pages:
1
2
|
Deleting Folders in QB - Rokkuman - 02-11-2004 For goodness sakes, don't ask why I wanna know... How would I delete an entire folder through QB? I tried Shell "del", but that didn't work... Deleting Folders in QB - KiZ - 02-11-2004 Errr... check RMDIR: Quote:âQuickSCREEN⺠âDetails⺠âExample⺠âContents⺠âIndex⺠Deleting Folders in QB - Sterling Christensen - 02-11-2004 But to use that the directory must be empty. To delete any directory, do this: Code: SHELL "deltree path\dirname /y" Deleting Folders in QB - na_th_an - 02-11-2004 That won't work in my computer, as my switch would be /s. In spanish, "Yes" is "Si", and they translated the OS... Deleting Folders in QB - Z!re - 02-11-2004 Make a recursive function... [pseudo code] shell dir [with the dir only switch] > afile (note, afile must be a random filename as this is a recursive function, use afile$=hex$(10000*rnd) or something) open afile and read it do go into the first dir (shell "cd "+dirname$ call this function remove all files in dir (kill *.*) go back (shell cd..) remove dir (rmdir) loop until eof(afile) close afile kill afile [/pseudo code] I don't think that the DIR switches (when it comes to sorting order /ogn) or displaying info one page at a time (/P) is translated a good method to retreive all files and dirs in the current folder is: SHELL "DIR /-p/-w/ogn/-s/b/-v/-4 " + mask$ + " > temp.tmp" where mask$ is the dir mask (*nana; *.exe aso) he open the file and there you have it, a nice long list of the curent directories content. I dont know if this works under XP thouh, but I can't see any reason why it shouldnt. Try: DIR /? to get a list of possible switches, a good idea is to disable any switches you dont use, like you don't want your progam to halt every page when you are writing to a file, so you add /-p to disable it. Deleting Folders in QB - KiZ - 02-12-2004 Quote:That won't work in my computer, as my switch would be /s. In spanish, "Yes" is "Si", and they translated the OS... Ahh. So in that case, Rockuman's harddrive deleting virus wouldnt work in Spain. Fair enough. :rotfl: Deleting Folders in QB - Zack - 02-12-2004 No use making your own recursive function...use MSDOS's. Deleting Folders in QB - Z!re - 02-12-2004 Yes Zack, care to explain? :lol: There is no pure DOS way of doing it, there is always the translation issue. Deltree nana Ãr du säker pÃ¥ att du vill ta bort nana och hela innehÃ¥llet [J/N] My switch would be | j Deleting Folders in QB - Zack - 02-12-2004 (oops...I didn't see that) Sorry...stupid me. Deleting Folders in QB - Plasma - 02-12-2004 Shelling sucks. Code: ' Deletes a directory and all files and |