Saturday, September 3, 2011

Struggling with CMD files on Windows

Since the old times of DOS, the MS scripting syntax has been probably one of the most pathetic and horrendous pieces of shit I have ever seen in my life.
Bat files, cmd files, all pathetic spaghetti mess full of GOTO and with cryptic error messages.
Unix shell scripts for all that matters are not a lot better, but slightly better yes they are.

Now I have to perform a "jar tvf" on all jars in a directory.

The only way I could do it is:

dir /b *.jar > alljars.txt


@echo off
echo > allfilesinjars.txt
FOR /F %%G IN (alljars.txt) DO (
@echo %%G >> allfilesinjars.txt
jar tvf %%G >> allfilesinjars.txt
@echo "______________________" >> allfilesinjars.txt
)


(see http://ss64.com/nt/for_f.html for help)

It's crap but it works.

So any time I need a class, I just search it in the txt file instead of doing costly searches in the jars.




No comments: