challenge: batch file programming

I need a batch file program that will allow me (under windows 2000) to do something like deltree c:/long file name/long file name/directory with wildcards and long file name but, under windows 2000 deltree doesnt work, it has been replaced by rm which i beleive does not support wild cards.

Everything New Technology 1823 This topic was started by ,


data/avatar/default/avatar21.webp

13 Posts
Location -
Joined 2002-04-26
I need a batch file program that will allow me (under windows 2000) to do something like
 
deltree c:/long file name/long file name/directory with wildcards and long file name
 
but, under windows 2000 deltree doesnt work, it has been replaced by rm which i beleive does not support wild cards. is there any way to be able to delete directories that have long file names using wild cards in a batch file??

Participate on our website and join the conversation

You have already an account on our website? Use the link below to login.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


data/avatar/default/avatar35.webp

2172 Posts
Location -
Joined 2002-08-26
C:\>del /?
Deletes one or more files.
 
DEL [/P] [/F] [/Q] [/A[[:]attributes]] names
ERASE [/P] [/F] [/Q] [/A[[:]attributes]] names
 
names Specifies a list of one or more files or directories.
Wildcards may be used to delete multiple files. If a
directory is specified, all files within the directory
will be deleted.
 
/P Prompts for confirmation before deleting each file.
/F Force deleting of read-only files.
/S Delete specified files from all subdirectories.
/Q Quiet mode, do not ask if ok to delete on global wildcard
/A Selects files to delete based on attributes
attributes R Read-only files S System files
H Hidden files A Files ready for archiving
- Prefix meaning not
 
If Command Extensions are enabled DEL and ERASE change as follows:
 
The display semantics of the /S switch are reversed in that it shows
you only the files that are deleted, not the ones it could not find.
 
C:\>

data/avatar/default/avatar34.webp

50 Posts
Location -
Joined 2005-04-26
@echo off
IF "%1"=="/Y" GOTO NO_ASK
IF "%1"=="/y" GOTO NO_ASK
RMDIR /S %1
GOTO END
:NO_ASK
RMDIR /S/Q %2
:END
 
Fire up the mighty notepad
save it as Deltree.bat
 
thats the deltree emulator
 
use it as you would use deltree
 
 
 
 
 
 
 
 

data/avatar/default/avatar34.webp

50 Posts
Location -
Joined 2005-04-26
Originally posted by theefool:

Quote:Why create a batch file for deltree when you can just download it? 
http://home.kooee.com.au/kingull/deltree/DELTREE.zip
 
also rmdir and rd are the same thing.
 
 
LOLS!!!! that's good...... why not download it.....
 
 
What's wrong with Resource"fullness" and "create"tivity?
 
 
i think you're missing the cue, my friend....
 
It's better to know how to make things happen, than to ask how things happen..
 
thanks for the deltree link anyway.
 
cheers..

data/avatar/default/avatar04.webp

352 Posts
Location -
Joined 2003-03-28
No problem. A few years ago I and my friend made scripts for work. He'd write them in perl and I'd do dos batch files. Both the scripts did the same, we just tried to see who can make a better version. In the end, we just did it to challenge ourselves. Lotsa fun. Especially when it comes to sorting within a script.