VOGONS


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 1 of 9, by mrau

User metadata
Rank Oldbie
Rank
Oldbie

quite frankly i think this is a task for either binary or VB at the very least (unless you can live with limits on folder structure)

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 3 of 9, by mrau

User metadata
Rank Oldbie
Rank
Oldbie

you cannot execute an arbitrary number of FORs in dos, you need to run another interpreter

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 5 of 9, by Errius

User metadata
Rank l33t
Rank
l33t

Where's deltree for x64 systems BTW?

Is this too much voodoo?

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?

Reply 8 of 9, by mrau

User metadata
Rank Oldbie
Rank
Oldbie
Errius wrote:

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

and that would show how?

Reply 9 of 9, by Errius

User metadata
Rank l33t
Rank
l33t

It would halt with a memory error IIRC.

Is this too much voodoo?