unix script needs to be implemented in DOs Batch script

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
vijays3
Posts: 2
Joined: 02 Oct 2009 23:33

unix script needs to be implemented in DOs Batch script

#1 Post by vijays3 » 04 Oct 2009 07:02

Hi all,

I have a unix script which needs to be implemented in DOS script
here is the unix script..
#---------script starts
nofiles=`ls | grep ^a`

#This line gets the all file and dir which start wih 'a'

for i in $nofiles
do
if [ -d $i ] # This line checks for dir
then
rm $i
fi
done
#---------script ends

my requiremet is to have to delete all ej* directories from a folder in one go..

Thnaks

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 05 Oct 2009 14:51

for /d %%a in (ej*) do del /q /s "%%~a"

Post Reply