0

I have three subfolders: the folder GHI is inside DEF which is inside ABC. Each folder has a single class file (xyz.class). This means a directory structure like:

ABC/
    XYZ.class
    DEF/
        XYZ.class
        GHI/
            XYZ.class

The three XYZ.class files are not similar but share the same name.

I tried a script which uses JAD to decompile all the xyz.classes in the ABC, DEF, GHI folders and save the decompiled java file to a new location.

I have two problems:

  1. since the three files have the same name, a warning appears whether to overwrite or not
  2. I am able to save the three files in the same folder which I don't want. I want to create three similar folders (like ABC, DEF, GHI) in a desired location and save the newly created java.

Does anyone know what to do?

for /r . %G% in (*.class) do jad -s .java -af -d "%my_desired_filelocation%" "%G%"
shyam
  • 21
  • 4

1 Answers1

1

Something like this should get you started...

@echo off
for /R %%G in (*.class) do (
    echo %my_desired_filelocation%\%%~pG
    rem md "%my_desired_filelocation%\%%~pG"
    rem jad -s .java -af -d "%my_desired_filelocation%\%%~pG" "%%~fG"
)
David Ruhmann
  • 11,064
  • 4
  • 37
  • 47
  • but this is not working as expected... if the path is " C:\Users\Shyam\desktop\test1 " and my desired location is " C:\Users\shyam\Desktop\test2 " the above code is giving the following location " C:\Users\shyam\Desktop\test2\Users\Shyam\desktop\test1" – shyam Mar 06 '13 at 12:20