Jump to content
Compatible Support Forums
Sign in to follow this  
evilhomer

challenge: batch file programming

Recommended Posts

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??

Share this post


Link to post

C:\>del /?

Deletes one or more files.

 

DEL [/P] [/F] [/s] [/Q] [/A[[:]attributes]] names

ERASE [/P] [/F] [/s] [/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:\>

Share this post


Link to post

@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

 

 

 

 

 

 

 

 

Share this post


Link to post

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..

Share this post


Link to post

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.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×