Computing.Net > Forums > Windows 2000 > Equivalent DELTREE command in win2000

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Equivalent DELTREE command in win2000

Reply to Message Icon

Name: Boab
Date: November 27, 2000 at 03:23:28 Pacific
Comment:

Does anyone know if there is an equivalent command to deltree in win2000.
What i need to do is to delete all files and any subfolders from a folder from a batch file. In win95/98 i would use:
deltree foldername
or
deltree *.* to delete everything.

Win2000 has the RD or RMDIR but you appear to have to specify the folder name. I need to be able to use wildcards.
Any ideas?



Sponsored Link
Ads by Google

Response Number 1
Name: sander
Date: November 27, 2000 at 04:27:11 Pacific
Reply:

use: del /s
All special delete actions are included in the DEL command. Type "del /?" for all possible options.


0

Response Number 2
Name: Boab
Date: November 27, 2000 at 06:45:28 Pacific
Reply:

Tried del /s, it does delete all files in sub folders but leaves the folders.


0

Response Number 3
Name: sander
Date: November 27, 2000 at 09:31:55 Pacific
Reply:

Ok, I got it! Use rmdir /s /q !!!!!!!!!!!

D:\>rmdir /?
Removes (deletes) a directory.
RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path
/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.

/Q Quiet mode, do not ask if ok to remove a directory tree with /S


0

Response Number 4
Name: Boab
Date: November 28, 2000 at 02:27:18 Pacific
Reply:

RD looks good in theory, it will remove folders that are specified in the command line such as rd /s c:\test\test1 but when you try and use wildcards it gives the error below.
C:\> rd /s c:\test\*.*
c:\test\*.*, Are you sure (Y/N)? y
The filename, directory name, or volume label syntax is incorrect.

I am trying to create a batch file that will remove everything from the temp folder in win2000 and so the names of the folders will change. I can't find a solution anywhere!


0

Response Number 5
Name: Dac
Date: June 8, 2001 at 15:32:36 Pacific
Reply:

rmdir /S /Q c:\temp
rmdir /S /Q c:\winnt\temp
if not exist c:\temp mkdir c:\temp
if not exist c:\winnt\temp


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 2000 Forum Home


Sponsored links

Ads by Google


Results for: Equivalent DELTREE command in win2000

net use command in Win2000 www.computing.net/answers/windows-2000/net-use-command-in-win2000/19612.html

Deltree in windows2000 www.computing.net/answers/windows-2000/deltree-in-windows2000/8313.html

boot to DOS in Win2000 www.computing.net/answers/windows-2000/boot-to-dos-in-win2000/2967.html