Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Kill a directory in DOS
#1
Hi,

I have recently been able to Kill Filename$ but I would like a function to Kill Directory$

I know in Command.com and Cmd.exe the DEL command has /S to delete all subdirectories but Dosbox-X does not..

Or could a batch file do it??

Erik.
Reply
#2
(11-30-2023, 04:16 AM)eoredson Wrote: Hi,

I have recently been able to Kill Filename$ but I would like a function to Kill Directory$

I know in Command.com and Cmd.exe the DEL command has /S to delete all subdirectories but Dosbox-X does not..

Or could a batch file do it??

Erik.
Use the RMDIR command

https://qb64phoenix.com/qb64wiki/index.php/RMDIR
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#3
(11-30-2023, 04:26 AM)TerryRitchie Wrote:
(11-30-2023, 04:16 AM)eoredson Wrote: Hi,

I have recently been able to Kill Filename$ but I would like a function to Kill Directory$

I know in Command.com and Cmd.exe the DEL command has /S to delete all subdirectories but Dosbox-X does not..

Or could a batch file do it??

Erik.
Use the RMDIR command

https://qb64phoenix.com/qb64wiki/index.php/RMDIR
Nope. That only deletes an empty directory!?


[Image: deldir.png]
Reply
#4
(11-30-2023, 04:35 AM)eoredson Wrote:
(11-30-2023, 04:26 AM)TerryRitchie Wrote:
(11-30-2023, 04:16 AM)eoredson Wrote: Hi,

I have recently been able to Kill Filename$ but I would like a function to Kill Directory$

I know in Command.com and Cmd.exe the DEL command has /S to delete all subdirectories but Dosbox-X does not..

Or could a batch file do it??

Erik.
Use the RMDIR command

https://qb64phoenix.com/qb64wiki/index.php/RMDIR
Nope. That only deletes an empty directory!?
You can use the RD command at the command prompt with the /S switch but be very careful. Here is a link in the tutorial covering the command prompt commands RD and RMDIR.

https://www.qb64tutorial.com/lessoncli#h.qrrgmgz1s3g1
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#5
(11-30-2023, 04:38 AM)TerryRitchie Wrote:
(11-30-2023, 04:35 AM)eoredson Wrote:
(11-30-2023, 04:26 AM)TerryRitchie Wrote: Use the RMDIR command

https://qb64phoenix.com/qb64wiki/index.php/RMDIR
Nope. That only deletes an empty directory!?
You can use the RD command at the command prompt with the /S switch but be very careful. Here is a link in the tutorial covering the command prompt commands RD and RMDIR.

https://www.qb64tutorial.com/lessoncli#h.qrrgmgz1s3g1

As I already stated: Dosbox-X Rd does not have a /S switch.
Reply
#6
Ok, I'm confused. You're running QB64 programs in Dosbox?
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply
#7
I am running QB64 yes.

I am trying to be backward compatible to qb11, qb45, and qb71.
Reply
#8
(11-30-2023, 04:50 AM)eoredson Wrote: I am running QB64 yes.

I think this is a bad thread..

https://qb64phoenix.com/qb64wiki/index.php/RMDIR
Reply
#9
(11-30-2023, 04:53 AM)SMcNeill Wrote:
(11-30-2023, 04:50 AM)eoredson Wrote: I am running QB64 yes.

I think this is a bad thread..

https://qb64phoenix.com/qb64wiki/index.php/RMDIR
So, I should shell to RMDIR?
Reply
#10
As for doing it in a DosBox-X specific way, you should really read their documentation and learn the old commands which they emulate.  

https://github.com/joncampbell123/dosbox...d-Commands

Specifically scroll down and look at the DELTREE command: 
Quote:DELTREE (external command)

Deletes a directory and all the subdirectories and files in it.

Usage: DELTREE [/Y] [drive:]path [[drive:]path[…]]

Note: This will delete the entire directory tree. Please use this command with caution.
Reply




Users browsing this thread: 6 Guest(s)