VOGONS

Common searches


First post, by Malik

User metadata
Rank l33t
Rank
l33t

Currently, I'm toying around MS-DOS 3.3 in a Award 286/12 clone in 86Box.

Is there a way to create a batch script that is equivalent to using DELTREE command in verisons of DOS that do not come with that external command?

Basically, the batch file need to loop through every possible sub-directories, delete the contents in them, move up a level and delete that sub-directory and repeat the process upto the level of and including the parent directory.

Problem is I can't remember how to access unknown sub-directories automatically via a batch file, if there is a way.

FYI, I create my own batch files for creating a backup of Windows 3.x directory and restoring it. Also for moving whole directories around. (The MOVE command does not move directories to another location). I make use of both XCOPY and DELTREE in my batch files for this purpose (in my 486 with MS-DOS 6.22).

To keep the topic focused, we can keep the discussion to batch files scripting only. I can use DOS 6's DELTREE command in DOS 3.3. But wondering if I can program raw internal commands into a batch file to achieve this.

Any info is appreciated. Thanks.

5476332566_7480a12517_t.jpgSB Dos Drivers

Reply 2 of 9, by Errius

User metadata
Rank l33t
Rank
l33t

You can probably do this in modern DOS using some kind of FOR magic or by parsing DIR /B /AD calls, but I think those commands are much more basic in DOS 3.3.

Is this too much voodoo?

Reply 4 of 9, by Malik

User metadata
Rank l33t
Rank
l33t

Okay, thanks. I guess I'll just continue with XCOPY and DELTREE in my batch files, since DELTREE from later DOS still works with 3.3.

5476332566_7480a12517_t.jpgSB Dos Drivers

Reply 6 of 9, by dr_st

User metadata
Rank l33t
Rank
l33t

NT-based versions of Windows have the /S switch to RD/RMDIR, that deletes subdirectories recursively.

https://cloakedthargoid.wordpress.com/ - Random content on hardware, software, games and toys

Reply 7 of 9, by Errius

User metadata
Rank l33t
Rank
l33t

I remember having problems using RMDIR /S in Windows Server 2003 x64. It would bug out for very large directory trees (thousands of subdirectories).

Is this too much voodoo?