1

If I ran below batch file then it's working and 7z and timeout is recognized

FOR %%A IN (% C:\dfsdf_asdffd\dd_etgvssd%\*.axml) DO (
setlocal
 set filename=%%A
 call :tests
)
exit /b

:tests
set newname=%filename:~14%
set transname=%filename:~25%
timeout 5
7z e %newname%
move *.xml Agile_Original.xml
exit /b

But If I ran below batch file then cmd is saying that 7z, timeout is not recognized.

For /F "tokens=1* delims==" %%A IN (Input_values.properties) DO (
    IF "%%A"=="path" set path=%%B
    IF "%%A"=="url" set url=%%B
    IF "%%A"=="username" set username=%%B
    IF "%%A"=="password" set password=%%B
    IF "%%A"=="location" set location=%%B
)
FOR %%A IN (% C:\dfsdf_asdffd\dd_etgvssd%\*.axml) DO (
    setlocal
     set filename=%%A
     call :tests
    )
    exit /b

    :tests
    set newname=%filename:~14%
    set transname=%filename:~25%
    timeout 5
    7z e %newname%
    move *.xml Agile_Original.xml
    exit /b

As you can see I just added one loop to read contents from properties file

5
  • Is 7z in your PATH environment variable? I can't find "timeout" in your example Commented Jun 28, 2016 at 8:07
  • @FlorianStraub added timeout and yes I 7z is in my path variable. when I run without properties file extraction then it's executing. Commented Jun 28, 2016 at 8:13
  • 1
    don't use %path% as a user variable. It's a system variable that tells windows where to find it's executables. Change it to another name. Commented Jun 28, 2016 at 8:18
  • (same applies to %username%, although it's not that critcal)) Commented Jun 28, 2016 at 8:23
  • @Stephan yes I agree with you. I used not use %path% as a variable. Thanks. Please post it as answer, I will accept. Commented Jun 28, 2016 at 10:05

1 Answer 1

4

don't use %path% as a user variable. It's a system variable that tells windows where to find it's executables. Change it to another name.

(same applies to %username%, although it's not that critcal))

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.