```batch
@echo off
if "%1" == "" (
    echo "Usage: <outputDirectory>"
) else (

    if not exist "abc\cdf" mkdir abc\cdf

    if not exist "xyz" mkdir xyz
    if not exist "xyz\mno" mkdir xyz\mno
    xcopy export xyz\mno /e

    set xyz_JAR=xyz.jar
    set xyz_JAR_PATH=..\app\build\libs\

    set FILES=mno "%xyz_JAR%"

    copy "%xyz_JAR_PATH%%xyz_JAR%" xyz
    //copy ..\app\build\libs\xyz.jar xyz
    set ZIP_FILE=xyz_v0-8-0_export.zip

    if exist "xyz\mno\.zip" del xyz\mno\.zip
    cd "xyz"
    echo '%cd%'
    zip -r %ZIP_FILE% %FILES%
    del %xyz_JAR%
    echo y | del mno\config\*.*
    rmdir mno\config
    rmdir mno\out
    echo y | del /s mno\
    rmdir mno
    move %ZIP_FILE% ..\%1\%ZIP_FILE%
    cd ..
    rmdir xyz
)

```

Here is my .bat file which is being executed perfectly from command line. I would like to run the same from java where I am seeing issues at various stages

```java
        String command = "packageEGRC_export.bat"+" "+"exportEGRC";
        Process process = Runtime.getRuntime().exec(new String[] {"cmd.exe","/c",command},null,scriptDir);
        InputStream is = process.getInputStream();
        int i = 0;
        while( (i = is.read() ) != -1) {
            System.out.print((char)i);
        }
        process.waitFor();
        int exitValue = process.exitValue();

```

It is picking up bat file and executing till certain stage and failing at line 

```
    copy "%xyz_JAR_PATH%%xyz_JAR%" xyz

```

Saying not able to find the file path. But if I replace that with, it's working fine 

```
    copy ..\app\build\libs\xyz.jar xyz

```

And next not able to change directory to xyz --> `cd "xyz"`, it remains same working directory where it is being executed.

Any help on this would be appreciated.

Note: I don't want to change anything on .bat file because it is working perfectly from command line.