Compatible Support Forums: challenge: batch file programming

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

challenge: batch file programming

#1 User is offline   evilhomer 

  • enthusiast
  • Group: Members
  • Posts: 13
  • Joined: 26-April 02

Posted 13 October 2002 - 04:51 AM

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

#2 User is offline   adamvjackson 

  • Pooh-Bah
  • Group: Members
  • Posts: 2174
  • Joined: 26-August 02

Posted 13 October 2002 - 05:04 AM

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:\>
0

#3 User is offline   Exxccessive 

  • journeyman
  • Group: Members
  • Posts: 50
  • Joined: 26-April 05

Posted 27 April 2005 - 10:17 AM

@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








0

#4 User is offline   theefool 

  • enthusiast
  • Group: Members
  • Posts: 352
  • Joined: 28-March 03

Posted 27 April 2005 - 04:11 PM

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

#5 User is offline   Exxccessive 

  • journeyman
  • Group: Members
  • Posts: 50
  • Joined: 26-April 05

Posted 27 April 2005 - 05:00 PM

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

#6 User is offline   theefool 

  • enthusiast
  • Group: Members
  • Posts: 352
  • Joined: 28-March 03

Posted 27 April 2005 - 05:19 PM

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users