unix to dos script conversion

Hi guys,

What would be the equivalent of this unix command from a ksh script in a cmd script in DOS shell?

find . -type d -name blahblah -exec rm {} \;

Thanks!
vrungelAsked:
Who is Participating?
 
Alf666Connect With a Mentor Commented:
Hemm.... Install Cygwin (all these tools under Win32). Much more powerfull than the DOS sh*t.

www.cygwin.com

You'll get a shell (bash, ksh, whatever, you name it), find if you want, the binutils ...etc.

Just for your information, Your find command is not optimal. It executes rm once per file found. You'd rather use the following :

find . -type d -name blahblah | xargs rm

xargs executes the fewest possible time the command you give as argument. It's only limit is the arguments stack size.
0
 
fridomCEO/ProgrammerCommented:
That's one good tip. The other is using a scripting language. But the script is broken, so it does not matter ;-)

Regards
Friedrich
0
 
HamdyHassanCommented:
vrungel:
Try VBScript script , check FileSystemObject
0
 
HamdyHassanCommented:
0
 
vrungelAuthor Commented:
Thanks everyone, but I really needed to do it in DOS shell so the solution was

dir /s/b/ad blahblah > tempfile.txt
for /f  %f in (tempfile.txt) do del /s/f/q %f
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.