Kill a directory in DOS - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Kill a directory in DOS (/showthread.php?tid=2211) |
RE: Kill a directory in DOS - SMcNeill - 11-30-2023 (11-30-2023, 04:58 AM)eoredson Wrote:(11-30-2023, 04:53 AM)SMcNeill Wrote:So, I should shell to RMDIR?(11-30-2023, 04:50 AM)eoredson Wrote: I am running QB64 yes. Why would you need to shell?? RMDIR is a built in QB64 command, just as KILL is. Are we on the same page here?? You *ARE* asking how to use QB64 to remove directories, right?? RE: Kill a directory in DOS - eoredson - 11-30-2023 Deltree does not exist in Cmd.exe What I am trying to do: Code: (Select All) Print "Enter dir spec:"; But it has to be backwards compatible with QB1, QB4, and QB7.. RE: Kill a directory in DOS - SMcNeill - 11-30-2023 Code: (Select All) Print "Enter dir spec:"; If the directory isn't empty, then you'll need to write a routine to change to get the files in that directory, KILL them, and then RMDIR that directory. If there's directories inside that directory and not just files, then you'll want that routine to work recursively. RE: Kill a directory in DOS - eoredson - 11-30-2023 (11-30-2023, 05:10 AM)SMcNeill Wrote:Very well stated! That is what I was starting to do.. Could you write one?? It would have to be internal without any shell. Given the two functions Kill and RMdir it could be done... RE: Kill a directory in DOS - TerryRitchie - 11-30-2023 Hold the phone, I'm still stuck on the QB64 in the Dosbox thing. Compiled QB64 programs will not run in Dosbox. Dosbox emulates 16bit architecture. RE: Kill a directory in DOS - SMcNeill - 11-30-2023 (11-30-2023, 05:13 AM)eoredson Wrote:(11-30-2023, 05:10 AM)SMcNeill Wrote:Very well stated! That is what I was starting to do.. Sure, and it only takes a few minutes to do so: Code: (Select All)
And the file which you need to put in the QB64 folder to run with this -- direntry.h: RE: Kill a directory in DOS - eoredson - 11-30-2023 (11-30-2023, 05:37 AM)TerryRitchie Wrote: Hold the phone, I'm still stuck on the QB64 in the Dosbox thing. Compiled QB64 programs will not run in Dosbox. Dosbox emulates 16bit architecture. Ok. I am using QB64 for a directory delete function and it is compatible with QB1, 4, and 7 in Dosbox-x. Does that make sense?? All I want to do is Kill Dir$ RE: Kill a directory in DOS - eoredson - 11-30-2023 Hey. I got an idea for the makers of QB64pe: Maybe you could add a KillDir(Dir$) function!? RE: Kill a directory in DOS - SMcNeill - 11-30-2023 (11-30-2023, 06:07 AM)eoredson Wrote: Hey. I got an idea for the makers of QB64pe: That's what RMDIR does for you. It's just up to you to make certain the directory is empty, or use the function I provided above. RE: Kill a directory in DOS - TerryRitchie - 11-30-2023 (11-30-2023, 05:40 AM)eoredson Wrote:Nope, still doesn't make sense to me. The code provided by Steve will not work in anything except QB64. You need to write your code using QuickBasic 4.5 inside of DosBox. If Dosbox supports DELTREE then you can shell to that.(11-30-2023, 05:37 AM)TerryRitchie Wrote: Hold the phone, I'm still stuck on the QB64 in the Dosbox thing. Compiled QB64 programs will not run in Dosbox. Dosbox emulates 16bit architecture. Even if QB64 did include a KillDir command as you requested what good would that do you in Dosbox? QuickBasic would look at that command and error. |